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

Remove Window objects from the corresponding Select.pWin list when they are deleted, as they are, for example, when the ORDER BY clause is optimized out.

FossilOrigin-Name: fd7316cda0fdfe86985f41a97dff3beba188606ec9bc6fef38a686a6976a6e01
This commit is contained in:
dan
2019-07-22 16:33:02 +00:00
8 changed files with 77 additions and 33 deletions

View File

@@ -98,5 +98,29 @@ do_execsql_test 2.2.2 {
SELECT b=='2', rank() OVER (ORDER BY a) FROM t1
} {1 1 0 2}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 3.0 {
CREATE TABLE t1(a);
CREATE TABLE t2(a,b,c);
}
do_execsql_test 3.1 {
SELECT EXISTS(SELECT 1 FROM t1 ORDER BY sum(a) OVER ()) FROM t1;
}
do_execsql_test 3.2 {
SELECT sum(a) OVER () FROM t2
ORDER BY EXISTS(SELECT 1 FROM t2 ORDER BY sum(a) OVER ());
}
do_catchsql_test 3.3 {
SELECT a, sum(a) OVER (ORDER BY a DESC) FROM t2
ORDER BY EXISTS(
SELECT 1 FROM t2 ORDER BY sum(a) OVER (ORDER BY a)
) OVER (ORDER BY a);
} {1 {near "OVER": syntax error}}
finish_test