1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Fix the OR-optimization so that it always ignores subplans that do not use an index.

FossilOrigin-Name: cf452028d1be2c5578a07f6e21b4d8b613373eb8
This commit is contained in:
drh
2015-08-27 23:42:43 +00:00
4 changed files with 24 additions and 17 deletions

View File

@@ -322,9 +322,14 @@ do_test where2-6.3 {
} {6 2 49 51 99 6 10000 10006 100 6 10201 10207 sort t1 *}
do_test where2-6.4 {
queryplan {
SELECT * FROM t1 WHERE w=99 OR +w=100 OR 6=w ORDER BY +w
SELECT *, '|' FROM t1 WHERE w=99 OR +w=100 OR 6=w ORDER BY +w
}
} {6 2 49 51 99 6 10000 10006 100 6 10201 10207 sort t1 *}
} {6 2 49 51 | 99 6 10000 10006 | 100 6 10201 10207 | sort t1 *}
do_test where2-6.5 {
queryplan {
SELECT *, '|' FROM t1 WHERE w=99 OR y=10201 OR 6=w ORDER BY +w
}
} {6 2 49 51 | 99 6 10000 10006 | 100 6 10201 10207 | sort t1 *}
set ::idx {}
ifcapable subquery {set ::idx i1zyx}