Return an error if a "RANGE" window-frame uses "<expr> PRECEDING" or "<expr>

FOLLOWING".

FossilOrigin-Name: 786c87ba4150509e141baab32c51e64bbd3ce323735e0f47d65ed54d14215bc4
This commit is contained in:
dan
2018-07-05 18:34:53 +00:00
parent 683b0fffee
commit 7a606e1ab2
4 changed files with 28 additions and 9 deletions
+11
View File
@@ -217,5 +217,16 @@ do_execsql_test 9.0 {
} {
1 1 2 1,2 3 1,2,3 4 2,3,4 5 3,4,5
}
do_catchsql_test 9.1 {
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<5)
SELECT x, group_concat(x) OVER (ORDER BY x RANGE 2 PRECEDING)
FROM c;
} {1 {RANGE PRECEDING is only supported with UNBOUNDED}}
do_catchsql_test 9.2 {
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<5)
SELECT x, group_concat(x) OVER (ORDER BY x RANGE BETWEEN UNBOUNDED PRECEDING AND 2 FOLLOWING)
FROM c;
} {1 {RANGE FOLLOWING is only supported with UNBOUNDED}}
finish_test