1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix a segfault that could occur if the ORDER BY clause of a compound SELECT contains a sub-select that uses one or more window functions.

FossilOrigin-Name: 5ba15ebb34c3af85ef6c54bbb3acb57176d629cda83774881b2a6467e138e904
This commit is contained in:
dan
2021-04-12 16:59:28 +00:00
parent ff37491874
commit d487e37367
5 changed files with 28 additions and 12 deletions

View File

@@ -2045,4 +2045,19 @@ foreach {tn spec res} {
" $res
}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 67.0 {
CREATE TABLE t1(a, b, c);
CREATE TABLE t2(a, b, c);
}
do_catchsql_test 67.1 {
SELECT a,c,b FROM t1 INTERSECT SELECT a,b,c FROM t1 ORDER BY (
SELECT nth_value(a,2) OVER w1
WINDOW w1 AS ( ORDER BY ((SELECT 1 FROM v1)) )
)
} {1 {1st ORDER BY term does not match any column in the result set}}
finish_test