mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Ensure that negative numbers may not be used in frame offset clauses even if they are initially text value. e.g. (RANGE BETWEEN '-1' PRECEDING ...).
FossilOrigin-Name: 8b681b274dd01c3e0f76d5bbddcbb2450c6d9475b9cfa0db961a3ab5edf51db1
This commit is contained in:
@ -265,4 +265,21 @@ do_execsql_test 8.4 {
|
||||
FROM v1;
|
||||
} {0.0 0.0}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 9.0 {
|
||||
CREATE TABLE t1(a, b, c);
|
||||
INSERT INTO t1 VALUES(NULL,'bb',356);
|
||||
INSERT INTO t1 VALUES('CB','aa',158);
|
||||
INSERT INTO t1 VALUES('BB','aa',399);
|
||||
INSERT INTO t1 VALUES('FF','bb',938);
|
||||
}
|
||||
|
||||
do_catchsql_test 9.1 {
|
||||
SELECT sum(c) OVER (
|
||||
ORDER BY c RANGE BETWEEN 0 PRECEDING AND '-700' PRECEDING
|
||||
)
|
||||
FROM t1
|
||||
} {1 {frame ending offset must be a non-negative number}}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user