diff options
author | drh <> | 2021-01-27 19:15:06 +0000 |
---|---|---|
committer | drh <> | 2021-01-27 19:15:06 +0000 |
commit | 16cd8b96d3e2cb80e169beee529307d0f0fdf51c (patch) | |
tree | ba685ac33e574c43488e0600206627b5bdc40f79 /src/wherecode.c | |
parent | e5ceaac446d11372cd4b20cd5d9033a8e868c66a (diff) | |
parent | df1b52e72795ad08fc1b80027f3d4fbe6be408c4 (diff) | |
download | sqlite-16cd8b96d3e2cb80e169beee529307d0f0fdf51c.tar.gz sqlite-16cd8b96d3e2cb80e169beee529307d0f0fdf51c.zip |
Fix an issue with IN operator optimization introduced by
check-in [4a43430fd23f8835] and described by ticket [ee51301f316c09e9].
FossilOrigin-Name: 9dc7fc9f04d5c14fc436e5ff5b4c06c1969ddde5857ebeb5dccd59b7c748c339
Diffstat (limited to 'src/wherecode.c')
-rw-r--r-- | src/wherecode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index 4afe0ac9c..17dc36152 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -1743,6 +1743,12 @@ Bitmask sqlite3WhereCodeOneLoopStart( SWAP(u8, nBtm, nTop); } + if( iLevel>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 ){ + /* In case OP_SeekScan is used, ensure that the index cursor does not + ** point to a valid row for the first iteration of this loop. */ + sqlite3VdbeAddOp1(v, OP_NullRow, iIdxCur); + } + /* Generate code to evaluate all constraint terms using == or IN ** and store the values of those terms in an array of registers ** starting at regBase. |