/ Check-in [619f5cc7]
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:Make sure left-join markings are transferred to the virtual scalar subexpressions when decomposing a vector comparison in the ON clause of a LEFT JOIN. Fix for ticket [fef4bb4bd9185ec8f].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 619f5cc71774a37648e185c8502d7af14eb09b7f
User & Date: drh 2016-10-27 01:02:20
Context
2016-11-03
18:35
Make sure left-join markings are transferred to the virtual scalar subexpressions when decomposing a vector comparison in the ON clause of a LEFT JOIN. Fix for ticket [fef4bb4bd9185ec8f]. check-in: aba1e22b user: drh tags: branch-3.15
2016-10-27
14:51
Remove the mutex from test_multiplex.c. check-in: 6374978e user: dan tags: trunk
01:02
Make sure left-join markings are transferred to the virtual scalar subexpressions when decomposing a vector comparison in the ON clause of a LEFT JOIN. Fix for ticket [fef4bb4bd9185ec8f]. check-in: 619f5cc7 user: drh tags: trunk
2016-10-26
18:41
Small size reduction and performance enhancement in whereScanInit(). check-in: c23f5ef3 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/whereexpr.c.

  1194   1194       for(i=0; i<nLeft; i++){
  1195   1195         int idxNew;
  1196   1196         Expr *pNew;
  1197   1197         Expr *pLeft = sqlite3ExprForVectorField(pParse, pExpr->pLeft, i);
  1198   1198         Expr *pRight = sqlite3ExprForVectorField(pParse, pExpr->pRight, i);
  1199   1199   
  1200   1200         pNew = sqlite3PExpr(pParse, pExpr->op, pLeft, pRight, 0);
         1201  +      transferJoinMarkings(pNew, pExpr);
  1201   1202         idxNew = whereClauseInsert(pWC, pNew, TERM_DYNAMIC);
  1202   1203         exprAnalyze(pSrc, pWC, idxNew);
  1203   1204       }
  1204   1205       pTerm = &pWC->a[idxTerm];
  1205   1206       pTerm->wtFlags = TERM_CODED|TERM_VIRTUAL;  /* Disable the original */
  1206   1207       pTerm->eOperator = 0;
  1207   1208     }

Changes to test/rowvalue.test.

   251    251   do_catchsql_test 11.7 {
   252    252     SELECT * FROM t11 WHERE (a,a) IS 1;
   253    253   } {1 {row value misused}}
   254    254   do_catchsql_test 11.8 {
   255    255     SELECT * FROM t11 WHERE (a,a) IS NOT 1;
   256    256   } {1 {row value misused}}
   257    257   
          258  +# 2016-10-27: https://www.sqlite.org/src/tktview/fef4bb4bd9185ec8f
          259  +# Incorrect result from a LEFT JOIN with a row-value constraint
          260  +#
          261  +do_execsql_test 12.1 {
          262  +  DROP TABLE IF EXISTS t1;
          263  +  CREATE TABLE t1(a,b); INSERT INTO t1 VALUES(1,2);
          264  +  DROP TABLE IF EXISTS t2;
          265  +  CREATE TABLE t2(x,y); INSERT INTO t2 VALUES(3,4);
          266  +  SELECT *,'x' FROM t1 LEFT JOIN t2 ON (a,b)=(x,y);
          267  +} {1 2 {} {} x}
   258    268   
   259    269   finish_test