aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordan <Dan Kennedy>2022-10-07 18:57:15 +0000
committerdan <Dan Kennedy>2022-10-07 18:57:15 +0000
commit73c586bcbfb4adbd275c46cc151198b099a90a70 (patch)
treea8ea4d1f60300f3efc1448d94f5c478bdddba5d3 /src/wherecode.c
parent8a2254fa1ffd4bb083670aad50d095721bc079f7 (diff)
downloadsqlite-73c586bcbfb4adbd275c46cc151198b099a90a70.tar.gz
sqlite-73c586bcbfb4adbd275c46cc151198b099a90a70.zip
Fix a problem causing the seek-scan optimization to skip over valid rows that could occur when it is used with expressions of the form (a IN (?,?..) AND b >= ?). dbsqlfuzz ab1db6dc0efb04cba1cd3431ee6da4894fdc4520.
FossilOrigin-Name: 63d9efe277759d4daa29794846b60c6f55491496618f423f61468df72d0a4633
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index 67df73c66..85d9be501 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -2038,6 +2038,11 @@ Bitmask sqlite3WhereCodeOneLoopStart(
** guess. */
addrSeekScan = sqlite3VdbeAddOp1(v, OP_SeekScan,
(pIdx->aiRowLogEst[0]+9)/10);
+ if( pRangeStart ){
+ sqlite3VdbeChangeP5(v, 1);
+ sqlite3VdbeChangeP2(v, addrSeekScan, sqlite3VdbeCurrentAddr(v)+1);
+ addrSeekScan = 0;
+ }
VdbeCoverage(v);
}
sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint);