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

Fix a new problem in the BETWEEN operator when applied to a window function.

The problem was introduced yesterday by check-in [7ef7b23cbb1b9ace].

FossilOrigin-Name: 47e23064ba0205148f89e12803a62d5a4d6d2054f593f60c031e815112170b9b
This commit is contained in:
drh
2019-07-19 01:11:27 +00:00
parent 4509ffa362
commit b555b0806e
4 changed files with 29 additions and 10 deletions

View File

@ -1170,6 +1170,24 @@ do_execsql_test 29.2 {
11 K cc 'xyz' K |
}
# 2019-07-18
# Check-in [7ef7b23cbb1b9ace] (which was itself a fix for ticket
# https://www.sqlite.org/src/info/1be72aab9) introduced a new problem
# if the LHS of a BETWEEN operator is a WINDOW function. The problem
# was found by (the recently enhanced) dbsqlfuzz.
#
do_execsql_test 30.0 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a, b, c);
INSERT INTO t1 VALUES('BB','aa',399);
SELECT
count () OVER win1 NOT BETWEEN 'a' AND 'mmm',
count () OVER win3
FROM t1
WINDOW win1 AS (ORDER BY a GROUPS BETWEEN 4 PRECEDING AND 1 FOLLOWING
EXCLUDE CURRENT ROW),
win2 AS (PARTITION BY b ORDER BY a),
win3 AS (win2 RANGE BETWEEN 5.2 PRECEDING AND true PRECEDING );
} {1 1}
finish_test