1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Disable the OP_SeekScan opcode of the in-scan-vs-index optimization when

in PRAGMA reverse_unordered_selects mode, as the OP_SeekScan only works
with forwards scans.  Thanks to OSSFuzz for pointing out the problem to
us.

FossilOrigin-Name: c75c3a3b756635bfdab44e4b56a337e4a88af3a8803cd3e9a67abf3d0d3450dc
This commit is contained in:
drh
2020-10-02 02:02:18 +00:00
parent d7d406e81c
commit 4ad1a1c74c
4 changed files with 30 additions and 12 deletions

View File

@ -170,5 +170,20 @@ do_execsql_test whereA-5.1 {
SELECT a FROM t1 WHERE b=-99 OR b>1;
} {1}
# 2020-10-02 OSSFuzz find for an issue introduced by a check-in
# on the previous day.
#
reset_db
do_execsql_test whereA-6.1 {
CREATE TABLE t1(a, b);
CREATE INDEX t1aa ON t1(a,a);
INSERT INTO t1 VALUES(1,2);
ANALYZE;
UPDATE sqlite_stat1 SET stat='27 3 3' WHERE idx='t1aa';
ANALYZE sqlite_schema;
PRAGMA reverse_unordered_selects (1) ;
SELECT a FROM t1 WHERE a=1 OR a=2;
} {1}
finish_test