mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
For the MULTI-INDEX-OR optimization, when pushing down WHERE clause terms from
the main query into the various OR-term subqueries, do not push down slices of a vector comparison, since the right-hand operand of the comparison might have only been initialized in a different OR branch that was not taken. dbsqlfuzz 80a9fade844b4fb43564efc972bcb2c68270f5d1. FossilOrigin-Name: 9f67ad00cd38b7c5ec6d14b379e1a611777bbdf6901d843a80712ba7d94d6d33
This commit is contained in:
@ -708,5 +708,23 @@ do_execsql_test 31.2 {
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON b=NULL WHERE (c,d)==(SELECT 123, 456+a);
|
||||
} {}
|
||||
|
||||
# 2022-02-03 dbsqlfuzz 80a9fade844b4fb43564efc972bcb2c68270f5d1
|
||||
reset_db
|
||||
do_execsql_test 32.1 {
|
||||
CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT, c INT);
|
||||
CREATE TABLE t2(d INTEGER PRIMARY KEY);
|
||||
INSERT INTO t1(a,b,c) VALUES(500,654,456);
|
||||
INSERT INTO t1(a,b,c) VALUES(501,655,456);
|
||||
INSERT INTO t1(a,b,c) VALUES(502,654,122);
|
||||
INSERT INTO t1(a,b,c) VALUES(503,654,221);
|
||||
INSERT INTO t1(a,b,c) VALUES(601,654,122);
|
||||
INSERT INTO t2(d) VALUES(456);
|
||||
INSERT INTO t2(d) VALUES(122);
|
||||
SELECT a FROM (
|
||||
SELECT t1.a FROM t2, t1
|
||||
WHERE (987, t1.b) = ( SELECT 987, 654 ) AND t2.d=t1.c
|
||||
) AS t3
|
||||
WHERE a=1234 OR a<=567;
|
||||
} {500 502}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user