aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordrh <>2021-01-27 19:15:06 +0000
committerdrh <>2021-01-27 19:15:06 +0000
commit16cd8b96d3e2cb80e169beee529307d0f0fdf51c (patch)
treeba685ac33e574c43488e0600206627b5bdc40f79 /src/wherecode.c
parente5ceaac446d11372cd4b20cd5d9033a8e868c66a (diff)
parentdf1b52e72795ad08fc1b80027f3d4fbe6be408c4 (diff)
downloadsqlite-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.c6
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.