1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Allow vector IN(SELECT ...) expressions to use an index if either all the indexed columns are declared NOT NULL or if there is no difference between the expression evaluating to 0 and NULL (as in a WHERE clause).

FossilOrigin-Name: e2fd6f49b1b145bec09c581cc982b89429643ae9
This commit is contained in:
dan
2016-07-23 20:24:06 +00:00
parent 4097d0ca79
commit ba00e30a3a
6 changed files with 188 additions and 104 deletions

View File

@ -379,7 +379,7 @@ static int codeEqualityTerm(
}
assert( pX->op==TK_IN );
iReg = iTarget;
eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0);
eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0);
if( eType==IN_INDEX_INDEX_DESC ){
testcase( bRev );
bRev = !bRev;