-C Fix\smore\sunreachable\sbranches.
-D 2016-08-24T17:49:07.427
+C In\ssqlite3FindInIndex(),\simprove\sinternal\scomments\sand\savoid\san\nunreachable\sbranch.
+D 2016-08-24T18:51:23.484
F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a
F src/date.c 95c9a8d00767e7221a8e9a31f4e913fc8029bf6b
F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
F src/delete.c 76c084f0265f4a3cd1ecf17eee112a94f1ccbc05
-F src/expr.c 57b6d994d88d390a76ccb0ef81ea7b3bccf06fec
+F src/expr.c 3dc226ccd9eebee600253eba07b8d97534e49337
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c e2be0968c1adc679c87e467aa5b4f167588f38a8
F src/func.c 29cc9acb170ec1387b9f63eb52cd85f8de96c771
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 505a2f20eac62d4e170f003255c8984e4f3b0918
-R 3bf744e7d3187456751558defe5b0a1e
+P 6099c180db55396d6307538a5428ae5ef1b82d10
+R fa8e14e08c5acfaa4521c63ce095c576
U drh
-Z 0d5e4686e1b28bbfaea275d793f60f16
+Z 500a8a58193db1f42f4b49dd37f14aa8
-6099c180db55396d6307538a5428ae5ef1b82d10
\ No newline at end of file
+55945fc12f8157e32e6850e41575c0c6422d29e7
\ No newline at end of file
*/
assert(v);
if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){
+ /* The "x IN (SELECT rowid FROM table)" case */
int iAddr = sqlite3CodeOnce(pParse);
VdbeCoverage(v);
int i;
/* Check that the affinity that will be used to perform each
- ** comparison is the same as the affinity of each column. If
- ** it not, it is not possible to use any index. */
+ ** comparison is the same as the affinity of each column in table
+ ** on the RHS of the IN operator. If it not, it is not possible to
+ ** use any index of the RHS table. */
for(i=0; i<nExpr && affinity_ok; i++){
Expr *pLhs = sqlite3VectorFieldSubexpr(pX->pLeft, i);
int iCol = pEList->a[i].pExpr->iColumn;
- char idxaff = pTab->aCol[iCol].affinity;
+ char idxaff = pTab->aCol[iCol].affinity; /* RHS table affinity */
char cmpaff = sqlite3CompareAffinity(pLhs, idxaff);
+ testcase( cmpaff==SQLITE_AFF_BLOB );
+ testcase( cmpaff==SQLITE_AFF_TEXT );
switch( cmpaff ){
case SQLITE_AFF_BLOB:
break;
case SQLITE_AFF_TEXT:
- affinity_ok = (idxaff==SQLITE_AFF_TEXT);
+ /* sqlite3CompareAffinity() only returns TEXT if one side or the
+ ** other has no affinity and the other side is TEXT. Hence,
+ ** the only way for cmpaff to be TEXT is for idxaff to be TEXT
+ ** and for the term on the LHS of the IN to have no affinity. */
+ assert( idxaff==SQLITE_AFF_TEXT );
break;
default:
affinity_ok = sqlite3IsNumericAffinity(idxaff);