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

When generating code for a subquery, make a copy of the Select object and

generate the code out of the copy, in case the code generator makes
modifications to expression and the Select object needs to be reused.

FossilOrigin-Name: 4edddcc0bc8d71e9b8abac67bc3766f1d9143dddd1f59264859ce65e5aa9b8c6
This commit is contained in:
drh
2020-01-01 21:14:30 +00:00
parent 4ea562ee70
commit fc705da15d
4 changed files with 34 additions and 12 deletions

View File

@ -1184,5 +1184,18 @@ do_catchsql_test select-19.21 {
ORDER BY 1;
} {1 {table t1 has 1 columns but 15 values were supplied}}
# 2020-01-01 Found by Yongheng's fuzzer
#
reset_db
do_execsql_test select-20.10 {
CREATE TABLE t1 (
a INTEGER PRIMARY KEY,
b AS('Y') UNIQUE
);
INSERT INTO t1(a) VALUES (10);
SELECT * FROM t1 JOIN t1 USING(a,b)
WHERE ((SELECT t1.a FROM t1 AS x GROUP BY b) AND b=0)
OR a = 10;
} {10 Y}
finish_test