aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Improvements to the algorithm that determines which SELECT in a sequencedrh2019-08-31
| | | | | | of nested SELECT statements that an aggregate function belongs to. This resolves an issue identified by dbsqlfuzz. FossilOrigin-Name: d768007473f4ed40abbdf2c7e501b580b1cc37c1620c7cb90af1f208a8c35145
* Remove some affinity tests that became unreachable due to the prior change.drh2019-08-31
| | | FossilOrigin-Name: e2db1123faac26c0e0b6a1ebef1685ea7633bfcafd1ff743ba5380700f7745af
* The expression "(X IS FALSE) IN (FALSE)" does not imply that X is NOT NULL.drh2019-08-30
| | | | | Ticket [f8f472cbc77ba9c9] FossilOrigin-Name: dd66134817ecbda01c59a05ad0d6ac44bee700ab10cd2119c869dd69af293fe2
* The expression "(X IS FALSE) BETWEEN FALSE AND TRUE" does not implie thatdrh2019-08-30
| | | | | X is not NULL. Ticket [fba33c8b1df6a915] FossilOrigin-Name: 057fb8b1809b8b9c8fff0fd0804153b9644f0545c23c6ddc4758bda3381094b9
* The expression "(x IS FALSE) IS FALSE" does not imply that X is not NULL.drh2019-08-30
| | | | | Ticket [a6408d42b9f44462] FossilOrigin-Name: 45ff2b1f2693bb0231a864a511bb82cf2a5945ab3d806a5bbaf1517ecb287883
* Remove a faulty testcase() macro.drh2019-08-29
| | | FossilOrigin-Name: 80124ae55246b79023d23d3f55487ac3c0b40e8ff301c5daf4dd0631de8ddb29
* Fix other problems similar to ticket [c0390363].dan2019-08-29
| | | FossilOrigin-Name: 96ff2ba9c4bb71d5f7c6f359986a76a5364b7ac3e1a612441543a9eabecf31df
* Fix another case where SQLite assumes that if "~(? AND FALSE)" is true, "?" ↵dan2019-08-29
| | | | | must be non-null. FossilOrigin-Name: 616f5663b3dbd0929128c0990fc6d8bba1513c7ae196b87c450ac0b3b3203ecd
* Avoid assuming that for "~ (? OR TRUE)" to be true, "?" must not be NULL, ↵dan2019-08-29
| | | | | just as we do for "NOT (? OR TRUE)". Fix for ticket [c0390363]. FossilOrigin-Name: 84ae41fd2f50cb7c0c3f6522d0f94817e1bbf96eae5316279e3e32cee4e46e91
* Add support for "ORDER BY ... NULLS FIRST" and "ORDER BY ... NULLS LAST". ↵dan2019-08-27
|\ | | | | | | | | Use this to fix ticket [f8a7060e]. FossilOrigin-Name: 94085fb3e756bc984237b74b6e29c68462ad860870c64dcb5124feaeec387660
| * Merge in recent fixes from trunk.drh2019-08-26
| |\ | | | | | | FossilOrigin-Name: ad816d01d4bd3908ff2c574d79d1a29b6d732df308f2f1b1cdf7c0bc7c1bd7cf
| * \ Merge fixes from trunk. Also fix a reference to the KeyInfo.aSortOrder field,drh2019-08-22
| |\ \ | | | | | | | | | | | | | | | | which should now be KeyInfo.aSortFlags FossilOrigin-Name: 63e625c8eb06720eef30573aa562e38c90d228a9cf493f8bb59f09e50f0e3168
| * \ \ Update this branch with latest trunk changes.dan2019-08-21
| |\ \ \ | | | | | | | | | | FossilOrigin-Name: 6153bcf41a9aa0497f8210311c99ac23846223068f2b6a3a1c2d9dec7673c7e1
| * | | | Fix problems with window frames that use ORDER BY ... NULLS LAST etc.dan2019-08-19
| | | | | | | | | | | | | | | FossilOrigin-Name: 75d665a494dd7d6e77d5a80af386ee5accc0a53416d5493424dc0fef6c7b01a0
| * | | | Prevent NULLS FIRST/LAST from being used in CREATE INDEX and other statements.dan2019-08-19
| | | | | | | | | | | | | | | FossilOrigin-Name: bb9767a287097a615aeb4abdba689b10e1a1c36c016c8e55905b508075e62c86
| * | | | Merge trunk changes into this branch.dan2019-08-17
| |\ \ \ \ | | | | | | | | | | | | FossilOrigin-Name: db1e60800bc260cdcd604739daaba72c6b486158123fc62a3898aca4ead33cd3
| * | | | | 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
* | | | | | Omit the "x IN (y)" to "x==y" optimization of check-in [e68b427afbc82e20]drh2019-08-27
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (and ticket [e39d032577df6942]) as it causes difficult affinity problems as demonstrated by ticket [dbaf8a6820be1ece] and the original assertion fault is no longer a factor due to countless other changes of the previous 5 years. FossilOrigin-Name: 7f5168a76a400fc2e1e40c6950470b1bfb38a0be54fc5518c17c29fdae7d8f1f
* | | | | Improved detection of number of column mismatch for vector assignmentdrh2019-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | in UPDATE statements. Ticket [78acc9d40f0786e8] FossilOrigin-Name: bd4bda73df3794eef424eb13e08fc7cc54347d1ac69febaeec41f6b6cb4a42bc
* | | | | Fix typo in a comment. No code changes.drh2019-08-26
| |_|_|/ |/| | | | | | | FossilOrigin-Name: d0cc06d8a30444125e5655f6587a6355471c3447c08a2e5f7a046a4ed5cc5f09
* | | | Fix the likely(), unlikely(), and likelihood() functions so that they havedrh2019-08-22
| | | | | | | | | | | | | | | | | | | | | | | | no affinity, just like any other function. Ticket [7e07a3dbf5a8cd26] FossilOrigin-Name: 44578865fa7baf9760e355691ca9ce753295aaba7a4ee0bba29d4f85d9335bab
* | | | Fix a false-positive in sqlite3ExprNeedsNoAffinityChange().drh2019-08-22
| |_|/ |/| | | | | | | | | | | Ticket [ac184eb571d5e6e0] FossilOrigin-Name: e62eddbb048cbc2c15cb8eeb5b7a907e7cb08c21a27ebba96a069f62dbcb0f30
* | | Fix a segfault that could occur following an OOM while processing a SELECT ↵dan2019-08-20
| | | | | | | | | | | | | | | statement for which one or more of the expressions in the window frame declaration are themselves sub-selects that use window functions. FossilOrigin-Name: 75aec4fc886c04fe098828cc03bc72c197cbf40f0a1890fe5bbb98d4fd5c3c7e
* | | When populating an ephemeral b-tree for the RHS of an IN(...) clause, avoid ↵dan2019-08-17
| | | | | | | | | | | | | | | applying an affinity to a value that may be used later on for some other purpose. Fix for [c7a117190]. FossilOrigin-Name: 43e8b14314d876178d487c3b519296ac1de065fdcaa70768e40d684015bceb9d
* | | Ensure the functions that appear to be constant are not factored out ofdrh2019-08-17
| |/ |/| | | | | | | | | expression that originate on the right-hand side of a LEFT JOIN. Ticket [6710d2f7a13a2997] FossilOrigin-Name: 500c9152daaf11cf69d778aa8592175f6088337c6667c59af6df3a24cd81eb0e
* | Ensure that SQLite does not attempt to process incompatible window functions ↵dan2019-08-15
|/ | | | | in a single scan. Fix for [256741a1]. FossilOrigin-Name: 4f5b2d938194fab7627486e2ced633def2c90d9d3328e3700612feb9dbfa3d9a
* Fix the sqliteExprImpliesExpr() routine so that it recognizes thatdrh2019-08-10
| | | | | | "(NULL IS FALSE) IS FALSE" doe not implie "NULL NOT NULL". Ticket [9080b6227fabb466] FossilOrigin-Name: da01ba4fa47c6508b31533ccd769e637af04bd37f51463372fbc6c848d892a4d
* Performance optimization to the new affinity handling logic.drh2019-08-06
| | | FossilOrigin-Name: c9724e761bce7a4ae63ce3c1408795915865e8d3024dcb90690456f724f0df53
* 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
* Refactor field Expr.affinity into Expr.affExpr to avoid confusion with otherdrh2019-08-05
| | | | | | fields and variables named "affinity" and display affExpr it in sqlite3TreeViewExpr() output. FossilOrigin-Name: a29f2a7d07beff64e489e8f824babc6228c4a499fadc0ee701caa60a63baadcd
* Fix a bug in the linked-list handling code added by commit [fd7316cd].dan2019-07-22
| | | FossilOrigin-Name: 05080344dceafcfb670fbf01f7d69a1d713a54b6845f968a9cfe941fb53b13af
* Remove Window objects from the corresponding Select.pWin list when they are ↵dan2019-07-22
| | | | | deleted. FossilOrigin-Name: d23f33168222dfa40a67dc7de58057418151989e81429e4af47617e86db04667
* When processing a BETWEEN or CASE expression, avoid transforming a node of ↵dan2019-07-17
| | | | | the original expression into a TK_REGISTER node. Instead, take a copy and use it instead. Fix for [1be72aab9]. FossilOrigin-Name: 7ef7b23cbb1b9ace9f853238d9133320c153e6c3417e6823ab6394ee1fe56358
* Rework the FILTER clause implementation to share more code with window ↵dan2019-07-13
| | | | | functions. FossilOrigin-Name: 5dac8c38dfc3f41c5c8fb49ca35de7fd1b21f269d72e8ba6ba59ed0a4030a54d
* Minor performance improvement in sqlite3ExprDeleteNN().dan2019-07-10
| | | FossilOrigin-Name: bcc8b38ac75b731a4cd2873ab83f423be036467a511b617c779869de9bbb5383
* Experimental implementation of FILTER clause for aggregate functions.dan2019-07-02
| | | FossilOrigin-Name: 1f1ae2d6ac8dcbb62e5aa3dc17bc67d559cb565fc0d0a8c00a596075d35f8130
* Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE. ↵dan2019-06-16
| | | | | Instead, transform the uppermost Expr node in the expression tree that is not of this type. FossilOrigin-Name: ba7870e292919cf6c2f4b65b63fb0420ba2718eb0a797e0ba5302eec551a4238
* Handle expressions like "expr IS TRUE COLLATE xyz" in the same way as "expr ↵dan2019-06-12
| | | | | IS TRUE". Fix for [4d01eda8115b10d1]. FossilOrigin-Name: 5c6146b56a75a94f4baa10e95407c54dd0b9314a57a8702a4b96b15c4d7ac48c
* The affinity of the unlikely() function and its cousins should be "none".drh2019-06-11
| | | | | Ticket [0c620df60bffd9ef] FossilOrigin-Name: 614ecb0af47038848e8ba2aed6b92db6f33ddc4aea6361795dbde440380f5a35
* Make sure the affinity of the RHS of an IN operator does not affect thedrh2019-06-11
| | | | | | outcome even if the RHS expression contains a COLLATE clause. Ticket [57353f8243c637c0] FossilOrigin-Name: 0f748fe58bbbb7ce3f30303da25ec811b2bbce249549aa9c7927979ac5b38013
* Add the new sqlite3ExprUnmapAndDelete() function and use it in place ofdrh2019-06-11
| | | | | separate calls to sqlite3RenameExprUnmap() and sqlite3ExprDelete(). FossilOrigin-Name: 36ea13e0a851a749c9ef292377ecd82dbd4797d38df907b362487fa234c98ca5
* The ALTER TABLE command should not attempt to rename objects that are drh2019-06-11
| | | | | | | contained within an expression tree that has been optimized out because it is the other branch of an "AND false" expression. Ticket [533010b8cacebe82] FossilOrigin-Name: 04bd5cb73287f926f1ecf578998fa6ce1379474e86918c692eae5778d0817cef
* Update the sqlite3ExprCompare() routine so that it does not think "? IS NOT ↵dan2019-05-20
| | | | | TRUE" is the same as "? IS TRUE". Fix for [d3e7f2ba5b3]. FossilOrigin-Name: 99eba69b3a64741c69d167bf7a05dbe138c9e7faecc54a1b8d8220cb23902830
* Fix an assert() failure that could occur in a join query if the RHS of an ↵dan2019-05-18
| | | | | IN() operator is a list containing correlated expressions. This problem was introduced by checkin [e130319317e7611938] which was part of the fix for ticket [787fa716be3a7f650c] - so this commit is part of that ticket's fix too. FossilOrigin-Name: 778b1224a318d0137c7dab8361128f593506d3677267898119b934b4d66dfe38
* A new implementation for the sqlite3ExprImpliesExpr() theorem prover thatdrh2019-05-11
| | | | | | does a better job of answering TRUE to "(NOT A) OR B" when B is a NOT NULL expression. FossilOrigin-Name: b3413197f57711f04102d8cc6ff1e8ddbe0f5f2bcb6e1989cf314fa97f0ff7f1
* When considering partial indexes, do not assume that a "CASE x ..." ↵dan2019-05-11
| | | | | expression implies "x IS NOT NULL". FossilOrigin-Name: 1b24303220b7b4f59520176a0150fc619c668865450b4fdaa9ce4113a56e9687
* Do not assume that "x IS NOT ?" implies "x NOT NULL" when considering ↵dan2019-05-11
| | | | | partial indexes. Fix for ticket [8025674847]. FossilOrigin-Name: 0ba6d709b50d92db1542f2ff30535a80184b00dadf759d51e5cae7a6e37b1764
* Fix the NOT NULL logic in the theorem prover that determines when a partialdrh2019-05-04
| | | | | index can be used. Ticket [5c6955204c392ae763a95]. FossilOrigin-Name: c2e439bccc40825e211bfa9a88e6a251ff066ca7453d4e7cb5eab56ce7332635
* Mark a single branch as no longer reachable.drh2019-04-19
| | | FossilOrigin-Name: 4f35b3b78a461b0617a5cd04f60d2ab277bcc7c994dae463851a3cb5d041a723
* Improved optimization of the AND and OR operators.drh2019-04-19
| | | FossilOrigin-Name: 0fbd154eb419b57b9c064c1f47346835d6324388b966b73f8a0122de065f08b1