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

Fix a segfault that could occur following an OOM while processing a SELECT statement for which one or more of the expressions in the window frame declaration are themselves sub-selects that use window functions.

FossilOrigin-Name: 75aec4fc886c04fe098828cc03bc72c197cbf40f0a1890fe5bbb98d4fd5c3c7e
This commit is contained in:
dan
2019-08-20 14:43:01 +00:00
parent 95da9d5d46
commit 4780b9ad46
4 changed files with 32 additions and 10 deletions

View File

@ -224,4 +224,26 @@ do_faultsim_test 9 -end 25 -faults tmpread -body {
catch {db close}
tvfs delete
reset_db
do_execsql_test 10.0 {
CREATE TABLE t1(a, b, c, d);
CREATE TABLE t2(a, b, c, d);
}
do_faultsim_test 1 -faults oom* -prep {
} -body {
execsql {
SELECT row_number() OVER win
FROM t1
WINDOW win AS (
ORDER BY (
SELECT percent_rank() OVER win2 FROM t2
WINDOW win2 AS (ORDER BY a)
)
)
}
} -test {
faultsim_test_result {0 {}}
}
finish_test