/ Check-in [fb16348a]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a problem in the sqlite3ExprCompare() function that caused two dissimilar expressions to match if they have the same "COLLATE name" at the outer layer.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fb16348a5bd52752098c9aeacc3281c4e1e8eb5a868d131ea6c3271dc4226b40
User & Date: drh 2018-04-18 17:52:28
Context
2018-04-18
17:56
Add extra test cases for UPSERT. check-in: 7ea08d07 user: dan tags: trunk
17:52
Fix a problem in the sqlite3ExprCompare() function that caused two dissimilar expressions to match if they have the same "COLLATE name" at the outer layer. check-in: fb16348a user: drh tags: trunk
16:03
Add support for PostgreSQL UPSERT syntax and functionality. check-in: fba24aec user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  4898   4898       }
  4899   4899       return 2;
  4900   4900     }
  4901   4901     if( pA->op!=TK_COLUMN && pA->op!=TK_AGG_COLUMN && pA->u.zToken ){
  4902   4902       if( pA->op==TK_FUNCTION ){
  4903   4903         if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
  4904   4904       }else if( pA->op==TK_COLLATE ){
  4905         -      return sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ? 2 : 0;
         4905  +      if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
  4906   4906       }else if( strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
  4907   4907         return 2;
  4908   4908       }
  4909   4909     }
  4910   4910     if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 2;
  4911   4911     if( ALWAYS((combinedFlags & EP_TokenOnly)==0) ){
  4912   4912       if( combinedFlags & EP_xIsSelect ) return 2;