/ History for src/window.c
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History for src/window.c

2020-05-24
03:38
[66c5fd1e] part of check-in [ad7bb70a] When rewriting a query for window functions, if the rewrite changes the depth of TK_AGG_FUNCTION nodes, be sure to adjust the Expr.op2 field appropriately. Fix for ticket [7a5279a25c57adf1] (check-in: [ad7bb70a] user: drh branch: trunk, size: 104273)
2020-05-11
10:55
[194fc168] part of check-in [155e6649] Fix a problem handling constant integer expressions with collation sequences in PARTITION BY clauses. (check-in: [155e6649] user: dan branch: trunk, size: 103511)
2020-03-16
18:52
[ba1ffb78] part of check-in [38e3dd38] Fix handling of window functions in aggregate queries that have no GROUP BY clause. Also remove a faulty assert causing the error reported in [618156e3]. (check-in: [38e3dd38] user: dan branch: trunk, size: 103351)
2020-02-29
17:19
[0b824edb] part of check-in [1e174ed0] Fix a problem with window functions occuring within sub-selects that are part of an OR term in a WHERE clause of the outer SELECT. (check-in: [1e174ed0] user: dan branch: trunk, size: 103268)
2020-01-09
20:11
[f8ba2ee1] part of check-in [83dc5567] Fix an assert() in window.c that could fail with some obscure SELECT statements that use window functions. Ticket [678ecf429f8d1a5f] (check-in: [83dc5567] user: dan branch: trunk, size: 103096)
2020-01-01
20:17
[659d6132] part of check-in [ce141732] Ensure that when code for a scalar SELECT featuring window functions is generated more than once by the planner, separate ephemeral tables are opened for each instance. (check-in: [ce141732] user: dan branch: trunk, size: 102950)
2019-12-27
16:25
[87795bb8] part of check-in [99609786] Fix a problem with window functions in aggregate queries that do not have GROUP BY clauses. (check-in: [99609786] user: dan branch: trunk, size: 102876)
15:31
[c5c7da1a] part of check-in [45c64d39] Do not mistake constant integers in a PARTITION BY expression for references to ORDER BY style references to values returned by the SELECT statement. (check-in: [45c64d39] user: dan branch: trunk, size: 102804)
2019-12-25
23:54
[a5b69ea3] part of check-in [fa58aad4] When the sqlite3WindowRewrite() routine detects and error, have it convert the SELECT statement into just "SELECT null" so that it does not leave the parse tree in a goofy state that can cause problems with subsequent code before the stack has a chance to unwind and report the error. Ticket [d87336c81c7d0873] (check-in: [fa58aad4] user: drh branch: trunk, size: 102764)
2019-12-19
20:37
[da010455] part of check-in [e2bddcd4] When an error occurs while rewriting the parser tree for window functions in the sqlite3WindowRewrite() routine, make sure that pParse->nErr is set, and make sure that this shuts down any subsequent code generation that might depend on the transformations that were implemented. This fixes a problem discovered by the Yongheng and Rui fuzzer. (check-in: [e2bddcd4] user: drh branch: trunk, size: 102518)
2019-12-18
00:05
[913a1069] part of check-in [1ca0bd98] When processing constant integer values in ORDER BY clauses of window definitions (see check-in [7e4809eadfe99ebf]) be sure to fully disable the constant value to avoid an invalid pointer dereference if the expression is ever duplicated. This fixes a crash report from Yongheng and Rui. (check-in: [1ca0bd98] user: drh branch: trunk, size: 102358)
2019-11-23
16:34
[a77f1207] part of check-in [d66f95a5] Abort the window function tree rewrite early following an OOM. (check-in: [d66f95a5] user: drh branch: trunk, size: 102266)
15:10
[35148e95] part of check-in [57070c68] Avoid evaluating PARTITION BY or ORDER BY expressions multiple times for window function queries that use multiple window functions with the same window-definition. (check-in: [57070c68] user: dan branch: trunk, size: 102165)
2019-11-16
11:33
[b5bed964] part of check-in [0adb273f] Fix a potential NULL pointer dereference on a RENAME TABLE that references a VIEW with a logic error in a window function in the ORDER BY clause. (check-in: [0adb273f] user: drh branch: trunk, size: 101873)
2019-11-14
13:24
[ea53cef2] part of check-in [d0bc7db6] Ensure that the same subquery does not go through the window-function rewrite more than once, even when that subquery is part of a virtual table constraint that lacks the omit flag. (check-in: [d0bc7db6] user: drh branch: trunk, size: 101861)
2019-09-25
18:44
[064f2514] part of check-in [36d35dbd] Add a missing VdbeCoverage() macro. (check-in: [36d35dbd] user: drh branch: trunk, size: 101791)
17:47
[a1edfb8a] part of check-in [a1988445] Remove an unused variable. (check-in: [a1988445] user: drh branch: trunk, size: 101770)
16:41
[e8ef31a0] part of check-in [5fe15c1d] Further simplifications to window-function code. (check-in: [5fe15c1d] user: dan branch: trunk, size: 101846)
02:07
[49e97e32] part of check-in [489a1eb3] Simplifications to the window-function code. (check-in: [489a1eb3] user: drh branch: trunk, size: 103357)
2019-09-24
20:20
[1dcacaee] part of check-in [040e196a] Bug fixes for window frames of the form (... RANGE BETWEEN b PRECEDING AND a PRECEDING) or (... RANGE a FOLLOWING AND b FOLLOWING) where (a > b). (check-in: [040e196a] user: dan branch: trunk, size: 103247)
2019-09-23
12:38
[af649dd0] part of check-in [f907395e] Omit the sqlite3IntTokens array constant for a code simplification. (check-in: [f907395e] user: drh branch: trunk, size: 100804)
2019-09-16
05:34
[bf055d1b] part of check-in [ca564d4b] Fix a problem with processing CTEs that use a WINDOW clause. (check-in: [ca564d4b] user: dan branch: trunk, size: 100831)
2019-09-13
20:42
[2a10191a] part of check-in [4a197881] Fix a problem with using json1 window functions with an EXCLUDE clause. (check-in: [4a197881] user: dan branch: trunk, size: 100732)
17:05
[a35ad309] part of check-in [af1bc20f] Change the meaning of the SQLITE_SUBTYPE flag so that it indicates that the user-defined function cares about the subtypes of its arguments. (check-in: [af1bc20f] user: dan branch: window-functions-subtype-fix2, size: 100400)
2019-09-07
18:20
[b85ce577] part of check-in [6aa438ce] Add the SQLITE_SUBTYPE flag, which can be passed to sqlite3_create_function() and similar to indicate to the core that a user function is likely to use sqlite3_result_subtype(). (check-in: [6aa438ce] user: dan branch: window-functions-subtype-fix, size: 101108)
2019-09-04
06:56
[b1e56b12] part of check-in [cb3e2be6] Fix handling of NULL, text and blob values in window queries that use "RANGE BETWEEN A FOLLOWING AND B FOLLOWING", or "B PRECEDING AND A PRECEDING", where A>B. (check-in: [cb3e2be6] user: dan branch: trunk, size: 99794)
2019-08-30
19:45
[96b0c033] part of check-in [2925bfa5] Add test case to window8.test. Also fix an error in a comment in window.c. (check-in: [2925bfa5] user: dan branch: trunk, size: 99765)
18:02
[9f55b654] part of check-in [596ac2a4] Back out the change at [47cd634c98b502d4] which was incorrect. Add a test case so that we don't accidently back out that change again. (check-in: [596ac2a4] user: drh branch: trunk, size: 99765)
17:28
[ff37ca40] part of check-in [90046456] Add further comments to window.c. (check-in: [90046456] user: dan branch: trunk, size: 99709)
16:14
[701bea99] part of check-in [39b4cad4] Fix a bug in RANGE window functions that use "ORDER BY <expr> DESC NULLS FIRST" as the window-frame ORDER BY clause. (check-in: [39b4cad4] user: dan branch: trunk, size: 96719)
2019-08-29
16:17
[7d74882b] part of check-in [47cd634c] Remove an unreachable branch in the NULLS LAST logic of RANGE window functions. (check-in: [47cd634c] user: drh branch: trunk, size: 93563)
2019-08-21
19:58
[3ea716bb] part of check-in [b1cbcdc6] Add missing VdbeCoverage() macros to new code. (check-in: [b1cbcdc6] user: dan branch: nulls-last, size: 93596)
2019-08-19
19:59
[94dccce0] part of check-in [75d665a4] Fix problems with window frames that use ORDER BY ... NULLS LAST etc. (check-in: [75d665a4] user: dan branch: nulls-last, size: 93508)
2019-08-17
15:47
[331cdac4] part of check-in [db1e6080] Merge trunk changes into this branch. (check-in: [db1e6080] user: dan branch: nulls-last, size: 92807)
2019-08-15
13:53
[07e1c150] part of check-in [4f5b2d93] Ensure that SQLite does not attempt to process incompatible window functions in a single scan. Fix for [256741a1]. (check-in: [4f5b2d93] user: dan branch: trunk, size: 92769)
2019-08-12
16:36
[4d56fc1e] part of check-in [07babb0f] Experimental implementation of NULLS FIRST/LAST. This branch still has problems - the most significant of which is that ORDER BY clauses with a non-default NULLS FIRST/LAST qualifier can never use an index. (check-in: [07babb0f] user: dan branch: nulls-last, size: 92148)
2019-08-07
17:45
[98b2571c] part of check-in [8158d2ac] Eliminate some more cases of redundant sorting in window-function queries. (check-in: [8158d2ac] user: dan branch: trunk, size: 92110)
2019-08-06
14:37
[89778546] part of check-in [e8234f69] Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columns with no affinity can appear in a zero-terminated string. Use the new SQLITE_AFF_NONE macro for this new magic number. (check-in: [e8234f69] user: drh branch: pending, size: 91973)
2019-08-05
19:44
[773d7f89] part of check-in [7480db30] Fix the patch on this branch so that it works with sub-queries, as well as views. (check-in: [7480db30] user: dan branch: tkt-61c853-A, size: 91959)
19:32
[8da008a1] part of check-in [09cd0c0c] One of two options on how to address ticket [61c853857f40da49]. In this mode, we back out the documentation change of [07b7749da88d54e5] and change the core to work as it has been documented to work since 2017, rather than how it has actually worked since 2009. (check-in: [09cd0c0c] user: drh branch: tkt-61c853-A, size: 91973)
2019-07-22
19:01
[7728ba7a] part of check-in [e46b2afc] Consolidate the removal of Window objects from the Select.pWin list into a single subroutine. (check-in: [e46b2afc] user: drh branch: trunk, size: 91956)
16:20
[2c958b4b] part of check-in [d23f3316] Remove Window objects from the corresponding Select.pWin list when they are deleted. (check-in: [d23f3316] user: dan branch: winfunc-in-orderby, size: 91760)
2019-07-19
01:25
[79a3c9a9] part of check-in [ce6bf395] Fix a new problem in the BETWEEN operator when applied to a window function. The problem was introduced yesterday by check-in [7ef7b23cbb1b9ace]. This cherry-pick also needed to remove an assert from sqliteExprDelete(). (check-in: [ce6bf395] user: drh branch: branch-3.29, size: 91597)
01:11
[cdce0114] part of check-in [47e23064] Fix a new problem in the BETWEEN operator when applied to a window function. The problem was introduced yesterday by check-in [7ef7b23cbb1b9ace]. (check-in: [47e23064] user: drh branch: trunk, size: 91644)
2019-07-16
19:44
[e0b821aa] part of check-in [9e664585] Add new assert() statements in an attempt to help static analyzers avoid false-positives. (check-in: [9e664585] user: drh branch: trunk, size: 91606)
2019-07-13
16:22
[6cfb1b3c] part of check-in [5dac8c38] Rework the FILTER clause implementation to share more code with window functions. (check-in: [5dac8c38] user: dan branch: filter-clause, size: 91514)
09:56
[1d78310e] part of check-in [86ab963c] Merge latest trunk changes into this branch. (check-in: [86ab963c] user: dan branch: filter-clause, size: 91562)
2019-07-08
12:01
[3408c0f6] part of check-in [28196d89] Ensure collation sequences and affinities work in window function queries. Fix for [9ece23d2]. (check-in: [28196d89] user: dan branch: trunk, size: 91559)
2019-07-02
11:56
[c595e250] part of check-in [1f1ae2d6] Experimental implementation of FILTER clause for aggregate functions. (check-in: [1f1ae2d6] user: dan branch: filter-clause, size: 91186)
2019-05-10
14:26
[5be2cf7d] part of check-in [7e4809ea] Treat integer values in window definition ORDER BY clauses as constants, not as references to another expression. (check-in: [7e4809ea] user: dan branch: trunk, size: 91183)
2019-04-03
16:27
[038c2482] part of check-in [39225cc7] Fix a couple of problems with "RANGE BETWEEN <expr> PRECEDING AND <expr> PRECEDING" frames. (check-in: [39225cc7] user: dan branch: trunk, size: 91002)
2019-04-02
17:45
[1c3e20fc] part of check-in [bc0fb1c3] Use a separate bit on db->dbOptFlags to disable the xInverse optimization on window functions, rather than reusing the query-flattener disable bit. (check-in: [bc0fb1c3] user: drh branch: trunk, size: 90541)
2019-04-01
16:23
[aefd7e45] part of check-in [fa37cf9a] Frame range comparisons can never be NULL because the values will have been checked for NULL prior to the test. (check-in: [fa37cf9a] user: drh branch: trunk, size: 90545)
15:55
[8d840b83] part of check-in [a69bb4f2] Mark rowid-comparison opcodes as never-null for VDBE coverage tracking purposes. (check-in: [a69bb4f2] user: drh branch: trunk, size: 90477)
14:30
[76a3a9be] part of check-in [f56d305a] Improved VDBE branch coverage in the run-time frame-spec error detection logic of window functions. (check-in: [f56d305a] user: drh branch: trunk, size: 90450)
2019-03-31
18:17
[bd1e1c26] part of check-in [d03b6113] Add some missing VdbeCoverage() macros. (check-in: [d03b6113] user: drh branch: trunk, size: 90290)
2019-03-30
20:37
[a63ef839] part of check-in [b5f72f10] Fix issues with the previous check-in and add more VDBE branch coverage testing macros. (check-in: [b5f72f10] user: drh branch: oops, size: 90291)
20:10
[30cbf5f4] part of check-in [f24066f8] Enhanced VdbeCoverage() macros in the new windows function code. Later: This check-in causes an assertion fault. (check-in: [f24066f8] user: drh branch: oops, size: 89988)
2019-03-28
13:03
[92b6d593] part of check-in [ec2f207d] Improved TreeView display of Window objects. Change the Window.eType field to Window.eFrmType to avoid confusion with other "eType" values. (check-in: [ec2f207d] user: drh branch: trunk, size: 89815)
2019-03-27
14:58
[2e3fdb04] part of check-in [5be64ea8] Fix harmless compiler warnings seen with MSVC. (check-in: [5be64ea8] user: mistachkin branch: trunk, size: 89697)
2019-03-26
16:47
[adddab66] part of check-in [7927b6b0] Fix a problem with window frames that use "BETWEEN <start> AND 0 PRECEDING". (check-in: [7927b6b0] user: dan branch: trunk, size: 89689)
16:21
[ff72295b] part of check-in [a063f7c4] Fix harmless compiler warnings. (check-in: [a063f7c4] user: drh branch: trunk, size: 89215)
2019-03-21
13:51
[9849eee7] part of check-in [c7b33618] Remove assert() statements based on the counter-factual proposition that 0 is not a valid cursor number. (check-in: [c7b33618] user: dan branch: window-functions, size: 89080)
2019-03-19
19:19
[bcf909b9] part of check-in [e0255063] Fix a problem with EXCLUDE clauses on window frames with no ORDER BY. (check-in: [e0255063] user: dan branch: window-functions, size: 89144)
16:49
[9a860432] part of check-in [4f9b93e6] Add missing VdbeCoverage() macros to new code in window.c. (check-in: [4f9b93e6] user: dan branch: window-functions, size: 89013)
11:56
[bd0a1267] part of check-in [c02f77b1] Revert the OP_MustBeInt opcode implementation on this branch so that it again matches trunk. The extra functionality is no longer required. (check-in: [c02f77b1] user: dan branch: window-functions, size: 88475)
2019-03-18
21:19
[76d83479] part of check-in [1fbddf01] Add further tests for new window function functionality. (check-in: [1fbddf01] user: dan branch: window-functions, size: 88243)
18:55
[ff735851] part of check-in [2879a691] Always evaluate window functions using the alternative path usually only used by EXCLUDE frames if the SQLITE_QueryFlattener test flag is set. (check-in: [2879a691] user: dan branch: window-functions, size: 88230)
16:51
[aa50be1f] part of check-in [723c84be] Fixes for RANGE windows and NULL values. (check-in: [723c84be] user: dan branch: window-functions, size: 87324)
2019-03-16
20:29
[3c13b17c] part of check-in [cebe09e1] Fix problems with RANGE windows and string, blob and NULL values. (check-in: [cebe09e1] user: dan branch: window-functions, size: 87325)
10:15
[58c0e510] part of check-in [f2d5f7a2] In order to identify the first row of each partition, check if the rowid in the ephemeral table is 1 instead of using a dedicated flag register. (check-in: [f2d5f7a2] user: dan branch: window-functions, size: 86734)
2019-03-15
20:46
[d4124c8a] part of check-in [9b43c3ee] Implement the EXCLUDE clause for window frames. (check-in: [9b43c3ee] user: dan branch: window-functions, size: 86852)
2019-03-14
20:53
[5b103f63] part of check-in [d03c7533] Parse EXCLUDE clauses in window frames. They do not yet work. (check-in: [d03c7533] user: dan branch: window-functions, size: 84727)
16:36
[8b3081e3] part of check-in [7d66cd20] Add things to this branch that will be required to support the EXCLUDE clause. (check-in: [7d66cd20] user: dan branch: window-functions, size: 84657)
2019-03-13
17:20
[218582db] part of check-in [180be266] Avoid allocating excessive registers for the PARTITION BY expressions when processing window functions. (check-in: [180be266] user: dan branch: window-functions, size: 81274)
15:29
[e05db1c6] part of check-in [6ad55319] Remove rows from the ephemeral table used by window functions once they are no longer required. (check-in: [6ad55319] user: dan branch: window-functions, size: 81443)
08:28
[ac687a05] part of check-in [b1322ffb] Minor optimization in sqlite3WindowCodeStep(). (check-in: [b1322ffb] user: dan branch: window-functions, size: 80131)
2019-03-12
18:28
[536bc805] part of check-in [25ff7091] Allow real values to be used in PRECEDING and FOLLOWING expressions for RANGE window frames. (check-in: [25ff7091] user: dan branch: window-functions, size: 79947)
15:21
[4763c2e8] part of check-in [5129bcc9] Expand on header comment for sqlite3WindowCodeStep(). Further simplify the implementation of the same. (check-in: [5129bcc9] user: dan branch: window-functions, size: 79538)
2019-03-11
19:50
[f41e0b36] part of check-in [08126353] Remove "cache mode" from the window frame code generator. Handle the same cases by editing the window frame specification itself. (check-in: [08126353] user: dan branch: window-functions, size: 74975)
18:17
[ca0d94d2] part of check-in [6bd1a079] Simplify the windows frame code some. Add a comment explaining some of the VM code generated by sqlite3WindowCodeStep(). (check-in: [6bd1a079] user: dan branch: window-functions, size: 76436)
11:12
[199efb1a] part of check-in [e7bced73] Fix problems with "RANGE ... ORDER BY <expr> DESC" window frames. (check-in: [e7bced73] user: dan branch: window-functions, size: 71310)
2019-03-09
20:49
[bbdf43af] part of check-in [ffc32b24] Add support for RANGE window frames. Some cases still do not work. (check-in: [ffc32b24] user: dan branch: window-functions, size: 71011)
2019-03-08
20:02
[e2e56938] part of check-in [954bf369] Finish consolidation of window frame code. Add untested support for GROUPS frames. (check-in: [954bf369] user: dan branch: window-functions, size: 67905)
2019-03-07
20:47
[fd7eae2b] part of check-in [a5f68f66] Fix other "ROWS BETWEEN" cases on this branch. (check-in: [a5f68f66] user: dan branch: window-functions, size: 81459)
19:26
[00962a6b] part of check-in [093d2b25] Modify new window functions function so that cursors are stepped immediately after each operation, instead of immediately before. (check-in: [093d2b25] user: dan branch: window-functions, size: 90849)
2019-03-06
21:04
[06257715] part of check-in [45cbd3b4] Simplify the window function code generator some more. (check-in: [45cbd3b4] user: dan branch: window-functions, size: 90377)
17:12
[607664ea] part of check-in [e8eee566] Improvements to the way built-in window functions are handled. (check-in: [e8eee566] user: dan branch: window-functions, size: 89053)
2019-03-05
19:29
[d722f9b0] part of check-in [af0ea136] Extend windowCodeStep() to handle any ROWS PRECEDING/FOLLOWING frame specification. (check-in: [af0ea136] user: dan branch: window-functions, size: 87440)
2019-03-04
21:07
[b2316f60] part of check-in [e7a91f12] Support some "ROWS BETWEEN N PRECEDING AND M FOLLOWING" window functions without caching entire partitions. (check-in: [e7a91f12] user: dan branch: window-functions, size: 84209)
2019-02-16
17:27
[a96e58c9] part of check-in [c155125f] Add support for chaining of WINDOW definitions. (check-in: [c155125f] user: dan branch: window-functions, size: 77750)
2019-01-27
02:41
[df245638] part of check-in [0ea05a0e] Window functions that can abort should indicate this, so that if they are used in DML statement, a statement journal will be used. (check-in: [0ea05a0e] user: drh branch: trunk, size: 75489)
2019-01-26
16:34
[c59090ba] part of check-in [d536be69] Roll back the transaction if a write statement fails with OE_Abort but there is no open statement transaction. (check-in: [d536be69] user: dan branch: rollback-abort, size: 75522)
2019-01-17
15:40
[1f4f7c69] part of check-in [df08d472] Revamp the SrcList allocator routines to be methods of Parse instead of being methods of the "sqlite3" object, so that they can leave better error messages when the SrcList object grows too large. (check-in: [df08d472] user: drh branch: trunk, size: 75462)
2019-01-16
12:05
[5950fb4d] part of check-in [d45bee36] Avoid a dangling pointer comparison when renaming a table that has a trigger that itself contains a window function with an (illegal) column reference in a FOLLOWING expression. (check-in: [d45bee36] user: dan branch: trunk, size: 75501)
2018-12-29
02:26
[f4a9ac83] part of check-in [4a0929ac] A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewer memory allocations by deferring memory allocation until sqlite3VdbeResolveLabel() is called, at which point the code generator has a better idea of how big the relocation table needs to be. The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of Vdbe*. (check-in: [4a0929ac] user: drh branch: trunk, size: 75435)
2018-12-06
22:04
[ea81ecd0] part of check-in [94017454] Fix the sqlite3ExprDup() routine so that it makes complete duplications of subqueries containing window functions. (check-in: [94017454] user: drh branch: ticket-f09fcd17810f, size: 75400)
2018-10-23
13:48
[6550e285] part of check-in [059ff53a] Fix a problem with using window functions in compound (UNION, INTERSECT etc.) queries. (check-in: [059ff53a] user: dan branch: trunk, size: 75370)
2018-09-20
19:02
[a28d8d42] part of check-in [ad130bb8] Combine the Expr.pTab and Expr.pWin fields into a union named "y". Add a new EP_WinFunc property that is only true if Expr.y.pWin is a valid pointer. This reduces the size of the Expr object by 8 bytes, reduces the overall amount of code, and shaves over 1 million cycles off of the speed test. (check-in: [ad130bb8] user: drh branch: trunk, size: 75354)
2018-07-27
23:33
[4b503da9] part of check-in [02204f8b] Improvements to the parser to increase coverage. Fix the parser so that at least one expresssion is required after PARTITION BY and within the list of expressions on VALUES(). (check-in: [02204f8b] user: drh branch: trunk, size: 75249)
2018-07-11
03:27
[c61434ce] part of check-in [b170c009] Adjustments to VdbeCoverage macros to deal with byte-code branches that can never be taken in some directions. (check-in: [b170c009] user: drh branch: trunk, size: 75070)
2018-07-10
23:31
[59a256d2] part of check-in [94ac51cc] Remove incorrect ALWAYS() macros from the window function logic. (check-in: [94ac51cc] user: drh branch: trunk, size: 75033)
22:24
[f0ff1319] part of check-in [f7c239e9] Add VdbeModuleComment()s on the three main code generators for window functions. (check-in: [f7c239e9] user: drh branch: trunk, size: 75581)
20:50
[ba6d7cf7] part of check-in [f2057542] Minor comment changes. Add ALWAYS() macros on some unreachable branches in the xStep() methods of built-in window functions. (check-in: [f2057542] user: drh branch: trunk, size: 75390)
17:26
[8d53b617] part of check-in [687fe532] Fix a problem with using scalar sub-selects in window function queries. (check-in: [687fe532] user: dan branch: trunk, size: 74780)
17:10
[74d56384] part of check-in [76e42b70] Further improvements to bytecode branch testing. Fix cases where the macros said a branch could not be taken when in fact it could be. Alter some window function branch coverage macros to indicate that comparison operands cannot be NULL. (check-in: [76e42b70] user: drh branch: trunk, size: 73862)
05:11
[df2bc081] part of check-in [a9a30726] New VDBE comments and coverage macros. (check-in: [a9a30726] user: drh branch: trunk, size: 73808)
2018-07-09
22:49
[60b37494] part of check-in [5023b1b8] Fixes for various harmless compiler warnings. (check-in: [5023b1b8] user: drh branch: trunk, size: 73466)
17:33
[0d5d4bcd] part of check-in [8fdaf3f3] Remove redundant branches in window function processing. (check-in: [8fdaf3f3] user: drh branch: trunk, size: 72945)
13:31
[a3f2de2f] part of check-in [1a06e57a] Throw an error if the second argument passed to nth_value() is not a positive integer. (check-in: [1a06e57a] user: dan branch: trunk, size: 72915)
06:51
[fcc7f6fe] part of check-in [fe8aaf0c] Fix a bad assert() in window.c. (check-in: [fe8aaf0c] user: dan branch: trunk, size: 72648)
2018-07-08
01:02
[e42415fb] part of check-in [410e13b0] Identify specific FuncDef objects for window functions using the pointer to the function name (FuncDef.zName) rather than the pointer to the xStep method. This allows xStep method pointer to be replaced with a single noopStepFunc() procedure, and thus save having lots of different no-op step functions. (check-in: [410e13b0] user: drh branch: trunk, size: 72559)
2018-07-07
17:38
[0ff90007] part of check-in [63f4d306] Add missing VdbeCoverage() macro to window.c. (check-in: [63f4d306] user: dan branch: trunk, size: 71946)
17:30
[635b5bea] part of check-in [b76f35b0] Fix a problem with the handling of NULL values in the min() window function. (check-in: [b76f35b0] user: dan branch: trunk, size: 71927)
2018-07-06
17:19
[0e127e91] part of check-in [927b95a0] Try to improve the error messages for misformed frame specifications in window definitions. (check-in: [927b95a0] user: drh branch: trunk, size: 71798)
14:31
[b681846a] part of check-in [a6dffecc] Also disallow non-constant expressions in "<expr> PRECEDING" or "<expr> FOLLOWING" clauses. (check-in: [a6dffecc] user: dan branch: trunk, size: 70320)
14:15
[8f977b35] part of check-in [0f3f8fcd] Ensure an error is returned if the user specifies an unsupported frame type. (check-in: [0f3f8fcd] user: dan branch: trunk, size: 70214)
13:25
[5bb6f305] part of check-in [443f0c28] Remove some bad assert() statements from the implementations of window functions percent_rank() and cume_dist(). (check-in: [443f0c28] user: dan branch: trunk, size: 69591)
07:42
[6f58bfcd] part of check-in [d59bcc8e] Return an error if DISTINCT is used with a window-function (e.g. "count(DISTINCT <expr>) OVER (...)"). (check-in: [d59bcc8e] user: dan branch: trunk, size: 69701)
2018-07-05
21:22
[51827401] part of check-in [fa653805] Use separate opcodes, OP_AggValue and OP_AggInverse, for the new callbacks associated with Window Functions, for improved readability of EXPLAIN output. (check-in: [fa653805] user: drh branch: trunk, size: 69560)
18:34
[00df6e1b] part of check-in [786c87ba] Return an error if a "RANGE" window-frame uses "<expr> PRECEDING" or "<expr> FOLLOWING". (check-in: [786c87ba] user: dan branch: trunk, size: 69506)
2018-07-02
12:07
[7df0313f] part of check-in [4f3c8a82] Fix a segfault caused by invoking a regular aggregate as a window-function. And some problems with count(*) when used as a window-function. (check-in: [4f3c8a82] user: dan branch: trunk, size: 69308)
2018-06-27
20:24
[4403ae36] part of check-in [4383cb68] Add missing VdbeCoverage() and VdbeCoverageNeverTaken() macros to window.c. (check-in: [4383cb68] user: dan branch: exp-window-functions, size: 69097)
19:48
[14c64e07] part of check-in [336de43a] Avoid redundant ORDER BY operations when rewriting SELECT statements that contain window functions. (check-in: [336de43a] user: dan branch: exp-window-functions, size: 68305)
2018-06-22
20:51
[b4442598] part of check-in [5f04b016] Omit all window-function related code when building with SQLITE_OMIT_WINDOWFUNC. (check-in: [5f04b016] user: dan branch: exp-window-functions, size: 67946)
17:57
[b4a22460] part of check-in [ebe65b23] Merge latest trunk changes. (check-in: [ebe65b23] user: dan branch: exp-window-functions, size: 67878)
2018-06-21
19:20
[358312db] part of check-in [b84fbf16] Fix a problem with handling single row partitions in the percent_rank() window function. (check-in: [b84fbf16] user: dan branch: exp-window-functions, size: 67933)
2018-06-20
09:23
[79be282a] part of check-in [f41b6b73] Add tests to improve coverage of code in window.c. Fix a problem with "SELECT row_number() OVER ()". (check-in: [f41b6b73] user: dan branch: exp-window-functions, size: 67935)
2018-06-18
20:34
[32a74770] part of check-in [943bccd2] Fix problems with using window functions in CREATE VIEW statements. (check-in: [943bccd2] user: dan branch: exp-window-functions, size: 66762)
16:55
[7cd40b85] part of check-in [da03fb43] Add new API function sqlite3_create_window_function(), for creating new aggregate window functions. (check-in: [da03fb43] user: dan branch: exp-window-functions, size: 66277)
2018-06-15
20:46
[d80ec071] part of check-in [ac251f72] Add extra OOM test. (check-in: [ac251f72] user: dan branch: exp-window-functions, size: 66769)
19:01
[ffc0a18a] part of check-in [fadd4dc1] Fix another problem in lead()/lag(). And some errors that could occur following OOM faults. (check-in: [fadd4dc1] user: dan branch: exp-window-functions, size: 66848)
16:10
[3c94dfff] part of check-in [3839fb18] Fix a bug in the lead() and lag() window functions causing them to fail when used in queries featuring multiple window functions. (check-in: [3839fb18] user: dan branch: exp-window-functions, size: 66628)
2018-06-14
20:52
[8d9999b2] part of check-in [567e09ef] Fix a problem with handling of statements containing two or more different windows. (check-in: [567e09ef] user: dan branch: exp-window-functions, size: 66641)
19:06
[3fc03f5a] part of check-in [43eb1e75] Fix problem with window functions min() and max() when used with a PARTITION clause and a frame starting point other than "UNBOUNDED PRECEDING". (check-in: [43eb1e75] user: dan branch: exp-window-functions, size: 66647)
14:27
[0a6b366a] part of check-in [bb915854] Improve comments and code legibility in new file window.c. (check-in: [bb915854] user: dan branch: exp-window-functions, size: 66049)
2018-06-13
20:29
[4a26ff62] part of check-in [c34f31db] Fix problems with "RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING" window frames. (check-in: [c34f31db] user: dan branch: exp-window-functions, size: 63100)
2018-06-12
20:53
[45d149fe] part of check-in [6413e38a] Fix another issue to do with window-functions in aggregate queries. (check-in: [6413e38a] user: dan branch: exp-window-functions, size: 60366)
18:40
[5fc1e9a4] part of check-in [fe7081e0] Fix some problems with using window-functions in aggregate queries. (check-in: [fe7081e0] user: dan branch: exp-window-functions, size: 58282)
2018-06-11
20:50
[a5ebf5b1] part of check-in [0cd55e98] Clarify the relationship between a Window object and its associated Expr. (check-in: [0cd55e98] user: dan branch: exp-window-functions, size: 53353)
18:16
[0519e5a0] part of check-in [b6d9c7ed] Fix handling of window frames containing negative number of rows. e.g. "ROWS x PRECEDING AND y PRECEDING" where (x<y). (check-in: [b6d9c7ed] user: dan branch: exp-window-functions, size: 53729)
2018-06-09
17:43
[72c08229] part of check-in [ceaf798e] Add support for FILTER clause on aggregate window functions. (check-in: [ceaf798e] user: dan branch: exp-window-functions, size: 52677)
2018-06-08
20:58
[31bd22de] part of check-in [19c983b5] Add support for the WINDOW clause. (check-in: [19c983b5] user: dan branch: exp-window-functions, size: 51813)
16:11
[141a79da] part of check-in [236cb75b] Do not flatten sub-queries that contain window functions. (check-in: [236cb75b] user: dan branch: exp-window-functions, size: 51037)
2018-06-07
20:08
[4a476f74] part of check-in [ef342070] Add window functions lag() and lead(). (check-in: [ef342070] user: dan branch: exp-window-functions, size: 50198)
17:45
[c48dd2d7] part of check-in [060b2640] Add support for window function first_value(). (check-in: [060b2640] user: dan branch: exp-window-functions, size: 48009)
15:54
[7a79e54c] part of check-in [63002b9a] Fix problems with the nth_value() function. (check-in: [63002b9a] user: dan branch: exp-window-functions, size: 47343)
2018-06-06
20:51
[1da8978d] part of check-in [eb1fb420] Add implementation of nth_value() window function. (check-in: [eb1fb420] user: dan branch: exp-window-functions, size: 47403)
2018-06-05
16:16
[7f9f2c8a] part of check-in [2493ce1a] Add implementation of last_value() window function. (check-in: [2493ce1a] user: dan branch: exp-window-functions, size: 44836)
2018-06-04
18:55
[ea479ab9] part of check-in [3f093f60] Add implementation of window function ntile(). (check-in: [3f093f60] user: dan branch: exp-window-functions, size: 43268)
08:22
[0a6bc6bd] part of check-in [76543f7d] Add support for window function cume_dist(). Improve tests for percent_rank(). (check-in: [76543f7d] user: dan branch: exp-window-functions, size: 41392)
2018-06-02
21:04
[014c6c7a] part of check-in [91c1cb7a] Add support for window functions row_number(), rank(), dense_rank() and percent_rank(). (check-in: [91c1cb7a] user: dan branch: exp-window-functions, size: 40618)
2018-06-01
21:00
[59f519e2] part of check-in [b5b18f66] Allow an entire partition to be cached in a temp table for all types of window frames. This is required by nth_value() and others. (check-in: [b5b18f66] user: dan branch: exp-window-functions, size: 29537)
2018-05-30
20:44
[1f2b1590] part of check-in [c16125a8] Allow min() and max() to be used as window functions. (check-in: [c16125a8] user: dan branch: exp-window-functions, size: 24074)
2018-05-28
18:30
[9877f4e1] part of check-in [e74c6e91] Further window frame tests and fixes. (check-in: [e74c6e91] user: dan branch: exp-window-functions, size: 21723)
2018-05-26
21:17
[e6132281] part of check-in [2c85668a] More fixes for different window frame types. (check-in: [2c85668a] user: dan branch: exp-window-functions, size: 21553)
2018-05-25
20:30
[793ad5ff] part of check-in [b4e9c686] Fix "RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING" window frame processing. (check-in: [b4e9c686] user: dan branch: exp-window-functions, size: 21397)
09:29
[4f9f7cef] part of check-in [5ac44872] Fixes for "ROWS BETWEEN <expr> FOLLOWING AND <expr> FOLLOWING" and "ROWS BETWEEN <expr> FOLLOWING AND UNBOUNDED FOLLOWING" (check-in: [5ac44872] user: dan branch: exp-window-functions, size: 19281)
2018-05-24
21:10
[e4441e8e] part of check-in [7b709a98] Allow "<expr> PRECEDING" to be used to specify the end of a window frame. (check-in: [7b709a98] user: dan branch: exp-window-functions, size: 18828)
17:49
[dc58ad62] part of check-in [ec7b648c] Support other frame types that use "<expr> PRECEDING" or "<expr> FOLLOWING" as start or end conditions. (check-in: [ec7b648c] user: dan branch: exp-window-functions, size: 17806)
2018-05-23
20:55
[1313e941] part of check-in [3a203660] Add support for "ROWS BETWEEN <expr> PRECEDING AND <expr> FOLLOWING" window frames. (check-in: [3a203660] user: dan branch: exp-window-functions, size: 16908)
2018-05-22
20:35
[37eb02c2] part of check-in [16168146] Add comments to window.c describing how other window frames will be implemented. (check-in: [16168146] user: dan branch: exp-window-functions, size: 10464)
2018-05-21
19:45
[da24f2e5] part of check-in [bc4b81d6] Begin adding support for more esoteric window frames. (check-in: [bc4b81d6] user: dan branch: exp-window-functions, size: 8632)
2018-05-17
19:24
[33d3751e] part of check-in [c9f0f140] Evaluate multiple window functions in a single pass if they use the same window definition. Add xValue callbacks for other built-in aggregate functions. (check-in: [c9f0f140] user: dan branch: exp-window-functions, size: 1849)
2018-05-16
20:58
[33cc7de7] part of check-in [3781e520] Start of experimental implementation of SQL window functions. Does not yet work. (check-in: [3781e520] user: dan branch: exp-window-functions, size: 1276) Added