Commit Graph

15 Commits

Author SHA1 Message Date
dan
a1a7e112fe Throw an error if the second argument passed to nth_value() is not a positive
integer.

FossilOrigin-Name: 1a06e57a0b4279fa580c7ff4f152645f005794aaf86eeabf694637b7da11f763
2018-07-09 13:31:18 +00:00
dan
f5e8e31399 Fix a bad assert() in window.c.
FossilOrigin-Name: fe8aaf0c806413965f50a03e34b5fdfaaa8b09dc0af73f41e830f7b664bd1ced
2018-07-09 06:51:36 +00:00
drh
e4984a2bf4 Try to improve the error messages for misformed frame specifications in
window definitions.

FossilOrigin-Name: 927b95a0812787bcb3c28d1a0ea94717dc2cc60f6d480623f0c7cbce0c546fc9
2018-07-06 17:19:20 +00:00
dan
bfead59b3b Also disallow non-constant expressions in "<expr> PRECEDING" or "<expr>
FOLLOWING" clauses.

FossilOrigin-Name: a6dffecc6b35c618cc5e5a06892765bdbec587dcd0ae8686c231a21516e38eab
2018-07-06 14:31:26 +00:00
dan
5d764ac9e6 Ensure an error is returned if the user specifies an unsupported frame type.
FossilOrigin-Name: 0f3f8fcde1a535bcf93e23a68d2411c21785d8c0cac1f9481a06e7225755cdbc
2018-07-06 14:15:49 +00:00
dan
287fa17b78 Prevent "UNBOUNDED FOLLOWING" from being used as the starting boundary of a
window-frame. And "UNBOUNDED PRECEDING" from being used as the ending
boundary.

FossilOrigin-Name: e51fdf66a24c27ba6491391fffcc88fc5ca2ae79cfc4ab769a149b19c394e308
2018-07-06 13:48:09 +00:00
dan
e33f6e7c91 Return an error if DISTINCT is used with a window-function (.i.e.
"count(DISTINCT <expr>) OVER (...)".

FossilOrigin-Name: d59bcc8eea4fcf0ee3c2263d31ee42f9f26c28434d2f0045f2d3329f18791d1c
2018-07-06 07:42:42 +00:00
dan
7a606e1ab2 Return an error if a "RANGE" window-frame uses "<expr> PRECEDING" or "<expr>
FOLLOWING".

FossilOrigin-Name: 786c87ba4150509e141baab32c51e64bbd3ce323735e0f47d65ed54d14215bc4
2018-07-05 18:34:53 +00:00
dan
683b0fffee Fix a problem in the xInverse method of window-function group_concat(1).
FossilOrigin-Name: 73391283101288251fe5d030ba12bcdabe8a781d41086afe3564c58c05d0fd5c
2018-07-05 18:19:29 +00:00
dan
d736829e8b Fix a problem in the xInverse callback for the built-in sum() window function.
FossilOrigin-Name: b6563647382634588ebe5c6a3c35c65a321dc1b3732c809d48ce46759b9dd80f
2018-07-02 17:45:59 +00:00
dan
f607bec749 Fix a segfault caused by having identical window functions in the select-list
and ORDER BY clause of a SELECT statement.

FossilOrigin-Name: 693b4350d741391226a33ab6a05eaad61e8ef1590176f01e8aed2a212e2d6419
2018-07-02 17:14:37 +00:00
dan
6b4b88208e Fix a crash caused by a LIKE pattern that consists of a single escape
character.

FossilOrigin-Name: bb9bfc3a12dfb89b1c58f5551cdc89ab7b0fbe03f285f2ed86611786ed02ffd9
2018-07-02 15:03:50 +00:00
dan
7262ca94cb Fix a segfault caused by invoking a regular aggregate as a window-function.
And some problems with count(*) when used as a window-function.

FossilOrigin-Name: 4f3c8a82fd1c5b14d84f2301e34cfc8d52fe4b3a60840c39e895c11f2da529d9
2018-07-02 12:07:32 +00:00
dan
6e2210e0a1 Have the tokenizer handle fallback for tokens "OVER" and "FILTER" in the same
way as it does for "WINDOW".

FossilOrigin-Name: 12d819e1c17d8036900352b0989c4bfcbc34193c3735bb9af7ab051f0f129d3d
2018-06-30 18:54:56 +00:00
dan
59ff42516c Instead of using a lemon %fallback directive, have the tokenizer try to figure
out whether an instance of "WINDOW" should be TK_WINDOW or TK_ID.

FossilOrigin-Name: 022079cb0d67be5ac0a50dd9a4d41ee55ce8df681ecd0a544170d75fc8649978
2018-06-29 17:44:52 +00:00