aboutsummaryrefslogtreecommitdiff
path: root/src/window.c
Commit message (Collapse)AuthorAge
...
* 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
* Fix a couple of problems with "RANGE BETWEEN <expr> PRECEDING AND <expr> ↵dan2019-04-03
| | | | | PRECEDING" frames. FossilOrigin-Name: 39225cc77579896214dceb93b7f224b4b3bc95b3505a2e19b41b0b18b184fbc4
* Use a separate bit on db->dbOptFlags to disable the xInverse optimization ondrh2019-04-02
| | | | | window functions, rather than reusing the query-flattener disable bit. FossilOrigin-Name: bc0fb1c324be2fd668bc4398c7d364b7e3c5a98537fe5fb58a125b66f3e6d041
* Frame range comparisons can never be NULL because the values will havedrh2019-04-01
| | | | | been checked for NULL prior to the test. FossilOrigin-Name: fa37cf9a6aa3e4325674cb6af68f617d25e349c3f694d0117a19a36fc42daf15
* Mark rowid-comparison opcodes as never-null for VDBE coverage trackingdrh2019-04-01
| | | | | purposes. FossilOrigin-Name: a69bb4f257500e40ef4056d5628ef25266def5bcef07eebdb471a79fffe80237
* Improved VDBE branch coverage in the run-time frame-spec error detectiondrh2019-04-01
| | | | | logic of window functions. FossilOrigin-Name: f56d305a7bad6608d51d8c8cef417ddb66cff50f0a75d28554ea669e47f3d90d
* Add some missing VdbeCoverage() macros.drh2019-03-31
| | | FossilOrigin-Name: d03b611302f68483770d49b113b4ed685ba03526d2007647c306f8ec7ae697d2
* Fix issues with the previous check-in and add more VDBE branch coveragedrh2019-03-30
| | | | | testing macros. FossilOrigin-Name: b5f72f10f2dfdbee9fe98c63ffb933e841203790746a920b99df14ca5c14127c
* Enhanced VdbeCoverage() macros in the new windows function code.drh2019-03-30
| | | FossilOrigin-Name: f24066f8dd847dfb656f26c4a8142e7fb6a412ffe325aea6254cb122cfbb3e1c
* Improved TreeView display of Window objects.drh2019-03-28
| | | | | | Change the Window.eType field to Window.eFrmType to avoid confusion with other "eType" values. FossilOrigin-Name: ec2f207dedb223077bbd3e4584499250eb12219712c917e930acccfa2c46e23b
* Fix harmless compiler warnings seen with MSVC.mistachkin2019-03-27
| | | FossilOrigin-Name: 5be64ea8e33f632f9c337feac9b0663d8e6e59fc9a71e5d832d9fd905c06458e