1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix a double-free that could occur when a component of a compound SELECT with an ORDER BY clause uses named window definitions.

FossilOrigin-Name: 92893b7980cbb0c6e26bc0b21390a717193205c9897fea5f26476462928897f9
This commit is contained in:
dan
2019-12-04 01:42:07 +00:00
parent 0232dade79
commit fcc057db25
4 changed files with 38 additions and 8 deletions

View File

@ -1272,4 +1272,31 @@ do_execsql_test 34.2 {
FROM t1;
}
#-------------------------------------------------------------------------
reset_db
do_catchsql_test 35.0 {
SELECT * WINDOW f AS () ORDER BY name COLLATE nocase;
} {1 {no tables specified}}
do_catchsql_test 35.1 {
VALUES(1) INTERSECT SELECT * WINDOW f AS () ORDER BY x COLLATE nocase;
} {1 {no tables specified}}
do_execsql_test 35.2 {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(1), (2), (3);
VALUES(1) INTERSECT
SELECT sum(x) OVER f FROM t1 WINDOW f AS (ORDER BY x) ORDER BY 1;
} {1}
do_execsql_test 35.3 {
VALUES(8) EXCEPT
SELECT sum(x) OVER f FROM t1 WINDOW f AS (ORDER BY x) ORDER BY 1;
} {8}
do_execsql_test 35.4 {
VALUES(1) UNION
SELECT sum(x) OVER f FROM t1 WINDOW f AS (ORDER BY x) ORDER BY 1;
} {1 3 6}
finish_test