/ Check-in [7cc9746c]
Login

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

Overview
Comment:Remove an unnecessary branch from expr.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rowvalue
Files: files | file ages | folders
SHA1: 7cc9746c5414e02012efb8180f9eca2646800e74
User & Date: dan 2016-09-06 17:21:17
Context
2016-09-06
18:51
Fix corer cases of vector IN operators where the RHS is a compound SELECT that includes an ORDER BY clause. check-in: 8329ac6f user: drh tags: rowvalue
17:21
Remove an unnecessary branch from expr.c. check-in: 7cc9746c user: dan tags: rowvalue
17:13
Avoid unnecessary memory allocations for aiMap in codeEqualityTerm(). check-in: 70319c3d user: drh tags: rowvalue
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/expr.c.

2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
          }
          sqlite3DbFree(pParse->db, dest.zAffSdst);
          assert( pKeyInfo!=0 ); /* OOM will cause exit after sqlite3Select() */
          assert( pEList!=0 );
          assert( pEList->nExpr>0 );
          assert( sqlite3KeyInfoIsWriteable(pKeyInfo) );
          for(i=0; i<nVal; i++){
            Expr *p = (nVal>1) ? sqlite3VectorFieldSubexpr(pLeft, i) : pLeft;
            pKeyInfo->aColl[i] = sqlite3BinaryCompareCollSeq(
                pParse, p, pEList->a[i].pExpr
            );
          }
        }
      }else if( ALWAYS(pExpr->x.pList!=0) ){
        /* Case 2:     expr IN (exprlist)







|







2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
          }
          sqlite3DbFree(pParse->db, dest.zAffSdst);
          assert( pKeyInfo!=0 ); /* OOM will cause exit after sqlite3Select() */
          assert( pEList!=0 );
          assert( pEList->nExpr>0 );
          assert( sqlite3KeyInfoIsWriteable(pKeyInfo) );
          for(i=0; i<nVal; i++){
            Expr *p = sqlite3VectorFieldSubexpr(pLeft, i);
            pKeyInfo->aColl[i] = sqlite3BinaryCompareCollSeq(
                pParse, p, pEList->a[i].pExpr
            );
          }
        }
      }else if( ALWAYS(pExpr->x.pList!=0) ){
        /* Case 2:     expr IN (exprlist)

Changes to test/rowvalue9.test.

231
232
233
234
235
236
237






238
239
240

  CREATE INDEX e1c ON e1(c);
}

do_execsql_test 5.1 {
  SELECT rowid FROM e1 WHERE (a, c) IN (SELECT x, y FROM e2);
} {1}







finish_test








>
>
>
>
>
>



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246

  CREATE INDEX e1c ON e1(c);
}

do_execsql_test 5.1 {
  SELECT rowid FROM e1 WHERE (a, c) IN (SELECT x, y FROM e2);
} {1}
do_execsql_test 5.2 {
  SELECT rowid FROM e2 WHERE rowid IN (SELECT +c FROM e1);
} {2}
do_execsql_test 5.3 {
  SELECT rowid FROM e2 WHERE rowid IN (SELECT 0+c FROM e1);
} {2}

finish_test