mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Do not mistake constant integers in a PARTITION BY expression for references to ORDER BY style references to values returned by the SELECT statement.
FossilOrigin-Name: 45c64d39d5afed7fdc6b1de19408559740d1fba1f5e0269ab68b132366a289e4
This commit is contained in:
@ -463,6 +463,32 @@ execsql_test 6.2 {
|
||||
(0, t0.c0) IN (SELECT DENSE_RANK() OVER(), LAG(0) OVER() FROM t0);
|
||||
}
|
||||
|
||||
==========
|
||||
|
||||
execsql_test 7.0 {
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INTEGER, b INTEGER, c INTEGER);
|
||||
INSERT INTO t1 VALUES(1, 1, 1);
|
||||
INSERT INTO t1 VALUES(1, 2, 2);
|
||||
INSERT INTO t1 VALUES(3, 3, 3);
|
||||
INSERT INTO t1 VALUES(3, 4, 4);
|
||||
}
|
||||
|
||||
execsql_test 7.1 {
|
||||
SELECT c, sum(c) OVER win1 FROM t1
|
||||
WINDOW win1 AS (ORDER BY b)
|
||||
}
|
||||
|
||||
execsql_test 7.2 {
|
||||
SELECT c, sum(c) OVER win1 FROM t1
|
||||
WINDOW win1 AS (PARTITION BY 1 ORDER BY b)
|
||||
}
|
||||
|
||||
execsql_test 7.3 {
|
||||
SELECT c, sum(c) OVER win1 FROM t1
|
||||
WINDOW win1 AS (ORDER BY 1)
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user