diff options
author | drh <> | 2022-02-04 13:05:29 +0000 |
---|---|---|
committer | drh <> | 2022-02-04 13:05:29 +0000 |
commit | 02e3e041343e6ac950771bb5ef813f1876f5036b (patch) | |
tree | 3cdfecba52004f51df6e964cf135252142ce9079 /test | |
parent | 7f1c11194825583ffee08ef1a57e6e0d0082c33b (diff) | |
download | sqlite-02e3e041343e6ac950771bb5ef813f1876f5036b.tar.gz sqlite-02e3e041343e6ac950771bb5ef813f1876f5036b.zip |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/rowvalue.test | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/rowvalue.test b/test/rowvalue.test index 7c101d9b3..92d3260e6 100644 --- a/test/rowvalue.test +++ b/test/rowvalue.test @@ -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 |