aboutsummaryrefslogtreecommitdiff
path: root/src/window.c
Commit message (Collapse)AuthorAge
...
* Alternative fix to ticket [c8d3b9f0a750a529]: Prior to deleting or modifyingdrh2020-06-07
| | | | | | an Expr not that is referenced by an AggInfo, modify the AggInfo to get its own copy of the original Expr. FossilOrigin-Name: 7682d8a768fbccfe0cc956e9f6481637146e1ab9763b248ff11052761ce32e32
* When rewriting a query for window functions, if the rewrite changes thedrh2020-05-24
| | | | | | depth of TK_AGG_FUNCTION nodes, be sure to adjust the Expr.op2 field appropriately. Fix for ticket [7a5279a25c57adf1] FossilOrigin-Name: ad7bb70af9bb68d192137188bb2528f1e9e43ad164c925174ca1dafc9e1f5339
* Fix a problem handling constant integer expressions with collation sequences ↵dan2020-05-11
| | | | | in PARTITION BY clauses. FossilOrigin-Name: 155e6649efe8614718be7ac6c3cccf5b073ae57496dc220db5e4313621f5188e
* Fix handling of window functions in aggregate queries that have no GROUP BY ↵dan2020-03-16
| | | | | clause. Also remove a faulty assert causing the error reported in [618156e3]. FossilOrigin-Name: 38e3dd389d142e520c71139ec84aa3c7722992af28a5f93a7f16e0ea176b74bb
* Fix a problem with window functions occuring within sub-selects that are ↵dan2020-02-29
| | | | | part of an OR term in a WHERE clause of the outer SELECT. FossilOrigin-Name: 1e174ed0d29366eb56ad1a0cc8defcb440b426bfd9525aed2f93468248606efc
* Fix an assert() in window.c that could fail with some obscure SELECT ↵dan2020-01-09
| | | | | statements that use window functions. FossilOrigin-Name: 83dc55679a91bf5d1d13706088ce58eed02b9aad1ad0ae237966e78e0d769663
* Ensure that when code for a scalar SELECT featuring window functions is ↵dan2020-01-01
| | | | | generated more than once by the planner, separate ephemeral tables are opened for each instance. FossilOrigin-Name: ce1417325273aba866767349b55d9bbfb61a08e716bebda2122918a9657ee38c
* Fix a problem with window functions in aggregate queries that do not have ↵dan2019-12-27
| | | | | GROUP BY clauses. FossilOrigin-Name: 99609786f485653464d1caef1d207ae299d28c925bff3e8e94891759b4765dcc
* Do not mistake constant integers in a PARTITION BY expression for references ↵dan2019-12-27
| | | | | to ORDER BY style references to values returned by the SELECT statement. FossilOrigin-Name: 45c64d39d5afed7fdc6b1de19408559740d1fba1f5e0269ab68b132366a289e4
* When the sqlite3WindowRewrite() routine detects and error, have it convertdrh2019-12-25
| | | | | | | | 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] FossilOrigin-Name: fa58aad48a788802b13a819e49f9b8787f713bbe395c46c7295e821c52c81738
* When an error occurs while rewriting the parser tree for window functionsdrh2019-12-19
| | | | | | | | 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. FossilOrigin-Name: e2bddcd4c55ba3cbe0130332679ff4b048630d0ced9a8899982edb5a3569ba7f
* When processing constant integer values in ORDER BY clauses of windowdrh2019-12-18
| | | | | | | 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. FossilOrigin-Name: 1ca0bd982ab1183bbafce0d260e4dceda5eb766ed2e7793374a88d1ae0bdd2ca
* Abort the window function tree rewrite early following an OOM.drh2019-11-23
| | | FossilOrigin-Name: d66f95a51530259ab48f78c9f91acc38055caf338b6fee846b99a8c077466e95
* Avoid evaluating PARTITION BY or ORDER BY expressions multiple times for ↵dan2019-11-23
| | | | | window function queries that use multiple window functions with the same window-definition. FossilOrigin-Name: 57070c68bbe15fc1d19a765182432e844c082909bdbc63b58fd86b96e2c521dd
* Fix a potential NULL pointer dereference on a RENAME TABLE that referencesdrh2019-11-16
| | | | | a VIEW with a logic error in a window function in the ORDER BY clause. FossilOrigin-Name: 0adb273f7e7671efb0e0a1619887e369500dfd2db7ef1b1e125c2414ea96e96f
* Ensure that the same subquery does not go through the window-function rewritedrh2019-11-14
| | | | | | more than once, even when that subquery is part of a virtual table constraint that lacks the omit flag. FossilOrigin-Name: d0bc7db6b0a53edc04815622c46250d26f526f56e59f14875f4e18c75b49000d
* Add a missing VdbeCoverage() macro.drh2019-09-25
| | | FossilOrigin-Name: 36d35dbd5a80dc4a149ed7409cc4b43712622fc4c6a8915b4fbb62fd1d6b7763
* Remove an unused variable.drh2019-09-25
| | | FossilOrigin-Name: a19884455b9bafcdc769362d61cfd02df1b5643263e004cb533698bbcfca752b
* Further simplifications to window-function code.dan2019-09-25
| | | FossilOrigin-Name: 5fe15c1d8383989257e11d1806e6b035acacd1b504ae385ba58d20db10f26eee
* Simplifications to the window-function code.drh2019-09-25
| | | FossilOrigin-Name: 489a1eb3aa2f1225b97b50a5f8688cf1a4ab0371973da1badc29616d70386c03
* Bug fixes for window frames of the form (... RANGE BETWEEN b PRECEDING AND a ↵dan2019-09-24
| | | | | PRECEDING) or (... RANGE a FOLLOWING AND b FOLLOWING) where (a > b). FossilOrigin-Name: 040e196a8be3ca41b9365310ab88c2a3cc84b918a6511c77a6d95d4b4e0da3ed
* Omit the sqlite3IntTokens array constant for a code simplification.drh2019-09-23
| | | FossilOrigin-Name: f907395ef5a2dc1d084b6a286af00de4c742cf12d4f347c21e1b757786508f57
* Fix a problem with processing CTEs that use a WINDOW clause.dan2019-09-16
| | | FossilOrigin-Name: ca564d4b5b19fe56842a04f31bb61352e6ae9d72a7e7634eb27ebcf5f670545a
* Fix a problem with using json1 window functions with an EXCLUDE clause.dan2019-09-13
| | | FossilOrigin-Name: 4a1978814da41608a16f6953bd575c97d587a34bd80b7ac0e619d62bfdc903d2
* Change the meaning of the SQLITE_SUBTYPE flag so that it indicates that the ↵dan2019-09-13
| | | | | user-defined function cares about the subtypes of its arguments. FossilOrigin-Name: af1bc20f502816db460d2b2d353f715da5cf660e59095de5214c829c1cb20981
* Add the SQLITE_SUBTYPE flag, which can be passed to ↵dan2019-09-07
| | | | | sqlite3_create_function() and similar to indicate to the core that a user function is likely to use sqlite3_result_subtype(). FossilOrigin-Name: 6aa438ce41d460a6782ae63503128b9140c28ff59c2b2eed48b004acf83e0560
* Fix handling of NULL, text and blob values in window queries that use "RANGE ↵dan2019-09-04
| | | | | BETWEEN A FOLLOWING AND B FOLLOWING", or "B PRECEDING AND A PRECEDING", where A>B. FossilOrigin-Name: cb3e2be674316e1d39968eb6567f1fe1b72f9d89af49640a9e83f944979c4cf0
* Add test case to window8.test. Also fix an error in a comment in window.c.dan2019-08-30
| | | FossilOrigin-Name: 2925bfa5971c8557ecaa6ac18df0825ebbbd1622017509e83451d90640146fa8
* Back out the change at [47cd634c98b502d4] which was incorrect. Add a testdrh2019-08-30
| | | | | case so that we don't accidently back out that change again. FossilOrigin-Name: 596ac2a4eab28b74f4050fb4eb71883f2a1421fdbccf302413e4653391bb52c9
* Add further comments to window.c.dan2019-08-30
| | | FossilOrigin-Name: 900464567b2a5ce0c278a3297e4be1968f609258608aa0fbe2fc67709aa22a4b
* Fix a bug in RANGE window functions that use "ORDER BY <expr> DESC NULLS ↵dan2019-08-30
| | | | | FIRST" as the window-frame ORDER BY clause. FossilOrigin-Name: 39b4cad4a51bb5116d62ffb16ac36d96a9280321b049eb2d008605392f52a459
* Remove an unreachable branch in the NULLS LAST logic of RANGE windowdrh2019-08-29
| | | | | functions. FossilOrigin-Name: 47cd634c98b502d40a493455ba6d73cbd0dae74944f9cf06fcbcd025f4b49d6e
* Add missing VdbeCoverage() macros to new code.dan2019-08-21
| | | FossilOrigin-Name: b1cbcdc6eb42cca0c42a05e0d6ba4c6c7f09adff0c59ecfc5b434a94dec07a41
* Fix problems with window frames that use ORDER BY ... NULLS LAST etc.dan2019-08-19
| | | FossilOrigin-Name: 75d665a494dd7d6e77d5a80af386ee5accc0a53416d5493424dc0fef6c7b01a0
* Merge trunk changes into this branch.dan2019-08-17
|\ | | | | FossilOrigin-Name: db1e60800bc260cdcd604739daaba72c6b486158123fc62a3898aca4ead33cd3
| * Ensure that SQLite does not attempt to process incompatible window functions ↵dan2019-08-15
| | | | | | | | | | in a single scan. Fix for [256741a1]. FossilOrigin-Name: 4f5b2d938194fab7627486e2ced633def2c90d9d3328e3700612feb9dbfa3d9a
* | Experimental implementation of NULLS FIRST/LAST. This branch still has ↵dan2019-08-12
|/ | | | | problems - the most significant of which is that ORDER BY clauses with a non-default NULLS FIRST/LAST qualifier can never use an index. FossilOrigin-Name: 07babb0f897fc8c9cb5b30481899c32fdd743f3f3ca508d8d957826252107dd5
* Eliminate some more cases of redundant sorting in window-function queries.dan2019-08-07
| | | FossilOrigin-Name: 8158d2aca68c5a253054376fdf1b8eaab2db874f4b93524742be7340e9c50dd5
* Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columnsdrh2019-08-06
| | | | | | with no affinity can appear in a zero-terminated string. Use the new SQLITE_AFF_NONE macro for this new magic number. FossilOrigin-Name: e8234f6939ccff4c10f741cf66d1c537cfebcbd0d1d79a618a64c755a7f087b5
* Fix the patch on this branch so that it works with sub-queries, as well as ↵dan2019-08-05
| | | | | views. FossilOrigin-Name: 7480db307c39b86bce269583e5917f5e1a3990500552fd98400ef3e7088c0b2a
* One of two options on how to address ticket [61c853857f40da49]. In thisdrh2019-08-05
| | | | | | | | mode, we back out the documentation change of [https://www.sqlite.org/docsrc/info/07b7749da88d54e5|&#91;07b7749da88d54e5&#93;] and change the core to work as it has been documented to work since 2017, rather than how it has actually worked since 2009. FossilOrigin-Name: 09cd0c0c6e6c963e0039a733876e5149adb3cd10e9b92699fa1dcb0633e997a4
* Consolidate the removal of Window objects from the Select.pWin list intodrh2019-07-22
| | | | | a single subroutine. FossilOrigin-Name: e46b2afc99329c43de08d4a2e6ade4d2239d7409c5d5626bf272a3e0dd24d1b4
* Remove Window objects from the corresponding Select.pWin list when they are ↵dan2019-07-22
| | | | | deleted. FossilOrigin-Name: d23f33168222dfa40a67dc7de58057418151989e81429e4af47617e86db04667
* Fix a new problem in the BETWEEN operator when applied to a window function.drh2019-07-19
| | | | | The problem was introduced yesterday by check-in [7ef7b23cbb1b9ace]. FossilOrigin-Name: 47e23064ba0205148f89e12803a62d5a4d6d2054f593f60c031e815112170b9b
* Add new assert() statements in an attempt to help static analyzers avoiddrh2019-07-16
| | | | | false-positives. FossilOrigin-Name: 9e66458592d40fbd96ea5f21339573110ca1cfe328238a020c9420a87d35dd72
* Rework the FILTER clause implementation to share more code with window ↵dan2019-07-13
| | | | | functions. FossilOrigin-Name: 5dac8c38dfc3f41c5c8fb49ca35de7fd1b21f269d72e8ba6ba59ed0a4030a54d
* Merge latest trunk changes into this branch.dan2019-07-13
|\ | | | | FossilOrigin-Name: 86ab963cc5743867e0535b78a5776e18c13835aa44bf2009f77642df8407cb3f
| * Ensure collation sequences and affinities work in window function queries. ↵dan2019-07-08
| | | | | | | | | | Fix for [9ece23d2]. FossilOrigin-Name: 28196d894ac9fad9d8f877c7bf17ec9d299d12acdcc942f9ea0783777b14fdc5
* | Experimental implementation of FILTER clause for aggregate functions.dan2019-07-02
|/ | | FossilOrigin-Name: 1f1ae2d6ac8dcbb62e5aa3dc17bc67d559cb565fc0d0a8c00a596075d35f8130
* Treat integer values in window definition ORDER BY clauses as constants, not ↵dan2019-05-10
| | | | | as references to another expression. FossilOrigin-Name: 7e4809eadfe99ebfd797a7c63501421021a720bbeed9fba81bebf630c58bb791