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

Avoid a stack overflow that could be caused by a recursively defined WINDOW() with a strategically embedded error.

FossilOrigin-Name: bada54bd6bf54190e40aa721b77081015957d204c7b6a9fdbe8c67bcf20798f8
This commit is contained in:
dan
2024-08-24 15:54:15 +00:00
parent 27095fc4a5
commit 58b08d7702
4 changed files with 30 additions and 10 deletions

View File

@ -54,5 +54,25 @@ do_execsql_test 1.3 {
5 5,4 5,4,1 5,4,1,6 5,4,1,6,3 5,4,1,6,3,2
}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 2.0 {
CREATE TABLE t1(x);
}
sqlite3_create_aggregate db
breakpoint
do_catchsql_test 2.1 {
SELECT min(x) OVER w1 FROM t1
WINDOW w1 AS (PARTITION BY x_count(x) OVER w1);
} {1 {x_count() may not be used as a window function}}
do_catchsql_test 2.2 {
SELECT min(x) FILTER (WHERE x_count(x) OVER w1) OVER w1 FROM t1
WINDOW w1 AS (PARTITION BY x OVER w1);
} {1 {near "OVER": syntax error}}
finish_test