-C Clarification\sof\scomments\son\ssqlite3FindInIndex().\s\sNo\schanges\sto\scode.
-D 2017-11-17T15:02:00.058
+C New\sassert()\sstatements\sin\sthe\srowvalue\sIN\sexpression\sprocessing.
+D 2017-11-17T17:32:40.141
F Makefile.in b142eb20482922153ebc77b261cdfd0a560ed05a81e9f6d9a2b0e8192922a1d2
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc a55372a22454e742ba7c8f6edf05b83213ec01125166ad7dcee0567e2f7fc81b
F src/walker.c da987a20d40145c0a03c07d8fefcb2ed363becc7680d0500d9c79915591f5b1f
F src/where.c 031a80bcafe93934fd7052f3031c9e7eb36b61754c6c84d6bf0833184abad3db
F src/whereInt.h 82c04c5075308abbac59180c8bad5ecb45b07453981f60a53f3c7dee21e1e971
-F src/wherecode.c 4a117dd5886616d074f7b6589c23bf742f5a9858d6ffdaf8b9d1f76ab06245d2
+F src/wherecode.c 8605c0ca0c34d4692011cf68a5f4cfc85352c1df917dc6eada320cecc4f5ea73
F src/whereexpr.c 427ea8e96ec24f2a7814c67b8024ad664a9c7656264c4566c34743cb23186e46
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 93e012a317c8a4bfb84327616a597acabfcb24417197eefdccb8031bcf64e0c0
-R 9e3518c1c08ebf61892be3d9ca3ce745
+P 071cabd23cd010180711a138f891a0e358031dd128532def4f62c5764651bace
+R e07fbdd249f84df3df0af0935ae0894c
U drh
-Z 183368b52c0a93e109b0b85758c70894
+Z dfffcc7482c8c9b6b4a114214fd236e3
-071cabd23cd010180711a138f891a0e358031dd128532def4f62c5764651bace
\ No newline at end of file
+00c328317473cee8fd7bd92c58409a356337b727cfa562bd8de59350d978769c
\ No newline at end of file
}
}
+#ifdef SQLITE_DEBUG
+/* Return true if the pSub ExprList is a subset of pMain. The terms
+** of pSub can be in a different order from pMain. The only requirement
+** is that every term in pSub must exist somewhere in pMain.
+**
+** Return false if pSub contains any term that is not found in pMain.
+*/
+static int exprListSubset(ExprList *pSub, ExprList *pMain){
+ int i, j;
+ for(i=0; i<pSub->nExpr; i++){
+ Expr *p = pSub->a[i].pExpr;
+ for(j=0; j<pMain->nExpr; j++){
+ if( sqlite3ExprCompare(0, p, pMain->a[j].pExpr, 0)==0 ) break;
+ }
+ if( j>=pMain->nExpr ) return 0;
+ }
+ return 1;
+}
+#endif /* SQLITE_DEBUG */
+
+
/*
** Generate code for a single equality term of the WHERE clause. An equality
** term can be either X=expr or X IN (...). pTerm is the term to be
pLhs = sqlite3ExprListAppend(pParse, pLhs, pNewLhs);
}
}
+
+ /* pRhs should be a subset of pOrigRhs (though possibly in a different
+ ** order). And pLhs should be a subset of pOrigLhs. To put it
+ ** another way: Every term of pRhs should exist in pOrigRhs and
+ ** every term of pLhs should exist in pOrigLhs. */
+ assert( db->mallocFailed || exprListSubset(pRhs, pOrigRhs) );
+ assert( db->mallocFailed || exprListSubset(pLhs, pOrigLhs) );
+
if( !db->mallocFailed ){
Expr *pLeft = pX->pLeft;