/ Check-in [ba7870e2]
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:Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE. Instead, transform the uppermost Expr node in the expression tree that is not of this type. Fix for [e1e07ef2].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-e1e07ef2
Files: files | file ages | folders
SHA3-256: ba7870e292919cf6c2f4b65b63fb0420ba2718eb0a797e0ba5302eec551a4238
User & Date: dan 2019-06-16 08:58:14
Original Comment: Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE. Instead, transform the uppermost Expr node in the expression tree that is not of this type.
Context
2019-06-16
14:56
Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE. Instead, transform the uppermost Expr node in the expression tree that is not of this type. Fix for [e1e07ef2]. check-in: 54110870 user: drh tags: trunk
08:58
Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE. Instead, transform the uppermost Expr node in the expression tree that is not of this type. Fix for [e1e07ef2]. Closed-Leaf check-in: ba7870e2 user: dan tags: tkt-e1e07ef2
2019-06-15
15:32
Fix minor problems in the test code in test_demovfs.c. check-in: ca4ddfef user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  3383   3383   }
  3384   3384   
  3385   3385   /*
  3386   3386   ** Convert a scalar expression node to a TK_REGISTER referencing
  3387   3387   ** register iReg.  The caller must ensure that iReg already contains
  3388   3388   ** the correct value for the expression.
  3389   3389   */
  3390         -static void exprToRegister(Expr *p, int iReg){
         3390  +static void exprToRegister(Expr *pExpr, int iReg){
         3391  +  Expr *p = sqlite3ExprSkipCollate(pExpr);
  3391   3392     p->op2 = p->op;
  3392   3393     p->op = TK_REGISTER;
  3393   3394     p->iTable = iReg;
  3394   3395     ExprClearProperty(p, EP_Skip);
  3395   3396   }
  3396   3397   
  3397   3398   /*

Changes to test/between.test.

   115    115   } {4 2 25 27 sort t1 i1zyx}
   116    116   do_test between-1.5.3 {
   117    117     queryplan {
   118    118       SELECT * FROM t1 WHERE 26 BETWEEN y AND +z ORDER BY +w
   119    119     }
   120    120   } {4 2 25 27 sort t1 *}
   121    121   
          122  +#-------------------------------------------------------------------------
          123  +reset_db
          124  +do_execsql_test between-2.0 {
          125  +  CREATE TABLE t1(x TEXT, y TEXT COLLATE nocase);
          126  +  INSERT INTO t1 VALUES('0', 'abc');
          127  +}
          128  +
          129  +foreach {tn expr res} {
          130  +  1 "x                BETWEEN 1 AND '5'" 0
          131  +  2 "x COLLATE binary BETWEEN 1 AND '5'" 0
          132  +  3 "x COLLATE nocase BETWEEN 1 AND '5'" 0
          133  +
          134  +  4 "y                  BETWEEN 'A' AND 'B'" 1
          135  +  5 "y COLLATE nocase   BETWEEN 'A' AND 'B'" 1
          136  +  6 "y COLLATE binary   BETWEEN 'A' AND 'B'" 0
          137  +  7 "(y COLLATE binary) BETWEEN 'A' AND 'B'" 0
          138  +} {
          139  +  set sql "SELECT $expr FROM t1"
          140  +  do_execsql_test between-2.1.$tn $sql $res
          141  +}
   122    142   
   123    143   finish_test