aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Give the expression pointer fields of AggInfo distinctive names in order todrh2020-06-09
| | | | | simplify tracking of all their uses. FossilOrigin-Name: a53bdd311c4154fd5e1131efbb9665362f79db5a35ce9f7b1547f74b8ee2d8ba
* Fix minor OOM problems.drh2020-06-07
| | | FossilOrigin-Name: 8b23d80271aab38abe42ee8b3ca4b746572ecef26c2a37b094b01560e6be9d45
* AggInfo objects might be referenced even after the sqlite3Select() functiondrh2020-06-07
| | | | | | that created them has exited. So AggInfo cannot be a stack variable. And it must not be freed until the Parse object is destroyed. FossilOrigin-Name: 3c840b4df306e2db1da08673e9ede973b4cb6d2b3f9eeeab5835e39452ee3056
* 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
* Small performance improvement and size reduction in the expressiondrh2020-05-27
| | | | | code generator. FossilOrigin-Name: eeb53e219551d8a05a87f1de9a7cd9af295d08a296f1f435a8509ea1252ccdcc
* Change a datatype from i16 to int to appease Converity and help eliminatedrh2020-05-27
| | | | | a false-positive. FossilOrigin-Name: 5b560ec49041d89c87ea3315d8fc17f7fb0e03a82091934be7373b290183f82e
* Innocuous changes to help Coverity avoid false-positives.drh2020-05-26
| | | FossilOrigin-Name: 4ec8a5a203f10d228d0b3389120638766cc343179dbe38d5dbf69b650765934c
* Defensive code that tries to prevent a recurrence of problems like thedrh2020-05-25
| | | | | one described in ticket [7a5279a25c57adf1] FossilOrigin-Name: 572105de1d44bca4f18c99d373458889163611384eebbc9659474874ee1701f4
* Move some utility Walker callbacks into the walker.c source file, as theydrh2020-05-24
| | | | | seem to belong there better. FossilOrigin-Name: dac438236f7c5419d4e7e094e8b3f19f83cd3b1a18bc8acb14aee90d4514fa3c
* Implement the IIF(x,y,z) SQL function that is short-hand fordrh2020-05-13
| | | | | "CASE WHEN x THEN y ELSE z END". For compatibility with SQL Server. FossilOrigin-Name: fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a
* Release some restrictions on columns added by ALTER TABLE so that theydrh2020-05-08
| | | | | only apply if the table contains one or more rows. FossilOrigin-Name: 3a16c0ce4d8851f79f670d94786032c8007619154ece44647dc9cc5b1f9654ff
* Ensure affinity is not discarded from a view column if the view appears on ↵dan2020-04-25
| | | | | the rhs of a LEFT JOIN. Fix for [45f4bf4e]. FossilOrigin-Name: ac31edd3eeafcef46164a4506bbc32c711bb7cd78378aeaa4c9bb12524ac5ea1
* The ALTER TABLE fix of check-in [7e5ad8e0ab7ee91a] is no longer needed duedrh2020-04-07
| | | | | | to the changes at check-in [4cf8721f5ceb1fda]. But, we keep the defense in place as an assert() for extra safety. FossilOrigin-Name: 230556e859536bbadf0daf8133a9a01ef4f03148b3296723e37bad66e3fc3d82
* Remove dead code that was added during initial development of RENAME COLUMNdrh2020-04-07
| | | | | but never actually served a purpose. FossilOrigin-Name: c95c4cda4640f05d61b13b4e60494dec07d4483734fc41ffcce73fb5163cbb0d
* When running ALTER TABLE, avoid adding some internally generated tokens to ↵dan2020-04-06
| | | | | the token map to improve performance on schemas with nested views. FossilOrigin-Name: 4cf8721f5ceb1fdaefdc355b3211f75c53c4cdf9d2582ca70fc96777a9b057c2
* Avoid factoring out constant expressions on the LHS of an IN(...) operator, ↵dan2020-04-03
| | | | | as the IN(...) operation may affect the affinity of these values. FossilOrigin-Name: 98d56b4a34fddcbaecd953a045ae0270b4d78c1edf34cc73522fb4e12743af80
* Reinstate the optimization that converts "x IN (y)" into "x==y".drh2020-03-26
| | | FossilOrigin-Name: 27936e6884e77093533719c7955a17f051cfb359872e51a6d1481152e6256443
* Rename sqlite3ExprCodeAtInit() to sqlite3ExprCodeRunJustOnce().drh2020-03-11
| | | | | Other changes to make the new code cleaner. Test cases added. FossilOrigin-Name: d7f18489978fdbbe3ab317485518cac91a75416ccef55898301afdd76d3b415b
* Do not factor out constant functions into the initialization section at thedrh2020-03-11
| | | | | | | end of the prepared statement, be cause if they throw an exception, it will abort the statement even if the function is never called. Better to put constant functions in an OP_Once block. FossilOrigin-Name: 97a18a5cd701848a9660385e31bffe2c397e3cfe57ccdb876f44d08c00d1d39a
* This variant to the fix for ticket [e0c2ad1aa8a9c691] uses fewer CPU cycles.drh2020-03-11
| | | FossilOrigin-Name: fb5a8a9edd0a4f979d6c30278d4ddc73c651f56ae989b4e5983fca36887c5ceb
* Enhanced detection logic for preventing the use of static schema expressionsdrh2020-03-10
| | | | | by code generating routines. FossilOrigin-Name: 5f60b527b938c0778e8f725c635ce0dc5ed7a4e01fd6252aa2cdb64da2f625bc
* Make a copy of the expression that defines a value of a generated columndrh2020-03-10
| | | | | before sending it to the code generator routines. FossilOrigin-Name: 03d201c041c17579e791c73fe6babd60b9f892a84ffd1470851f8eb2857d3990
* Apply the correct affinity transformations when pulling values off of thedrh2020-03-10
| | | | | sorter index used for GROUP BY. Ticket [e0c2ad1aa8a9c691] FossilOrigin-Name: 101f7dea75a203f1f3aa422a607ef701eb0901ba4d5e8d1075cd350454a61956
* The sqlite3ExprCodeFactorable() routine should make a copy of non-factorabledrh2020-03-10
| | | | | | expressions, as they might be coming from a DEFAULT or generated column in a table constraint. FossilOrigin-Name: a2d6f108c5d07559b125823a04c9cb072c80be80d7913097891a6192c7e1e225
* A better (smaller and faster) solution to ticket [4374860b29383380].drh2020-02-17
| | | FossilOrigin-Name: abc473fb8fb999005dc79a360e34f97b3b25429decf1820dd2afa5c19577753d
* Take care when checking the table of a TK_COLUMN expression node to see if thedrh2020-02-17
| | | | | | table is a virtual table to first ensure that the Expr.y.pTab pointer is not null due to generated column optimizations. Ticket [4374860b29383380]. FossilOrigin-Name: 9d0d4ab95dc0c56e053c2924ed322a9ea7b25439e6f74599f706905a1994e454
* Extend the OP_Copy-coalesce optimization fix of check-in [b36126c1889e323c]drh2020-02-04
| | | | | | so that it is also correctly disabled by the CASE operator. Ticket [9d3666754ac37d5a]. FossilOrigin-Name: 29a969d6b1709b80d9cb88b60971e4eb021f7f5f8ee9a619be74b833a78a35ef
* Merge in the untrusted-schema enhancements.drh2020-01-09
|\ | | | | | | | | | | See [/doc/87aea3ab1cdda453/doc/trusted-schema.md|doc/trusted-schema.md] for details. FossilOrigin-Name: 5720924cb07766cd54fb042da58f4b4acf12b60029fba86a23a606ad0d0f7c68
| * Block edgy functions used in DEFAULT constraints.drh2020-01-08
| | | | | | FossilOrigin-Name: da434dc149786e4b1cd80b3b2b25f8b614d0dec62d5439f839a66b536999e398
| * Performance improvements and test cases added. Allow "PRAGMA trusted_schema=ON"drh2020-01-08
| | | | | | FossilOrigin-Name: 30882ca80f6c51f6bb7b2692c1ac3f19a7c61a23aa8730be79aec0ae3ef08d54
| * Check for whether or not it is safe to use non-innocuous functions as thedrh2020-01-08
| | | | | | | | | | function is being coded, not when its name is resolved. FossilOrigin-Name: 1da802d54b689a462e1fe899c6ffa08ef14d34f36728b14b055b5a76b1edc274
* | Fix an assert() in window.c that could fail with some obscure SELECT ↵dan2020-01-09
|/ | | | | statements that use window functions. FossilOrigin-Name: 83dc55679a91bf5d1d13706088ce58eed02b9aad1ad0ae237966e78e0d769663
* Backout change [4d0b9109f7a5312d4e1] because the conditional it added isdrh2020-01-06
| | | | | no longer reachable due to check-in [1409758f72c0206c]. FossilOrigin-Name: b3f2696705cc3e7b038f156423f808432a4680ea7e313dc15e34bdf6b1845655
* Fix a false-positive in the register validity tracking logic by moving thedrh2020-01-04
| | | | | | temporary register release call before the jump that uses that temporary register. FossilOrigin-Name: 9da48a5ca66dc67c8f7fb2d2471dac7ea696e35ecba5ddf65747d08d452436c1
* Fix the OP_Copy-coalesce optimization so that if the previous row happensdrh2020-01-03
| | | | | | to end with OP_Copy but is not a candidate for the optimization due to jumps, then the optimization is correctly bypassed. FossilOrigin-Name: b36126c1889e323c9a8f04b4f4884576993c845e7d393e5e73aaa6ab5158c1f9
* When generating the name of a view (or common table expression) because thedrh2020-01-03
| | | | | | | SQL does not specify a name, avoid the names "true" and "false" which might be confused for the boolean literals of the same name, leading to an inconsistent abstract syntax tree. FossilOrigin-Name: ff9492d3ff733c222ea67f23d478df1547641b5e2e6dd870b0b29e25c13f3739
* Merge the latest enhancements from trunk.drh2020-01-02
|\ | | | | FossilOrigin-Name: bd57e6d923d3b04f0a07aaf18bf389d2b2b7efc7c57e8cb37e6ef910662d8397
| * Have the OP_ReleaseReg opcode also invalidate the registers if P5 is non-zero.drh2020-01-02
| | | | | | FossilOrigin-Name: 937be22106f7e3f08712febd342d6cb81d129f2d5ab24ce80b3a5c3f9bbde54e
| * Use OP_Copy instead of OP_SCopy to move the results of a scalar subquery.drh2020-01-02
| | | | | | FossilOrigin-Name: 435c272dcf6ed5f3acb564b8f959557145f117b869547b670258cf5a1908ab6b
| * The sqlite3WhereEnd() call now unwinds all Expr modifications made by thedrh2020-01-02
| | | | | | | | | | sqlite3WhereBegin(). FossilOrigin-Name: 7bfd42f1dc0c94f9bb74516e62fec8e39c20f4749f4e0972f66c2886d3c64f73
| * When generating code for a subquery, make a copy of the Select object anddrh2020-01-01
| | | | | | | | | | | | generate the code out of the copy, in case the code generator makes modifications to expression and the Select object needs to be reused. FossilOrigin-Name: 4edddcc0bc8d71e9b8abac67bc3766f1d9143dddd1f59264859ce65e5aa9b8c6
| * Fix the sqlite3ExprImpliesNonNullRow() routine so that it correctlydrh2020-01-01
| | | | | | | | | | handles a numeric comparison of two AND subexpressions. FossilOrigin-Name: 07e504d5174a1a8b1aa05ec5b44ac81ab3ea706c5a098caa88deb3d489cec8fb
| * New test-only SQL functions: implies_nonnull_row(), expr_compare(), anddrh2020-01-01
| | | | | | | | | | | | | | expr_implies_expr(). The SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control is modified to toggle internal function access on and off for a single database connection. FossilOrigin-Name: 473892a8eceacf24d57fd0c72ff2a0b8be4e0d75e0af7a30bdb24fbc3b453601
| * Factor out code generation for in-line SQL functions into a separate routinedrh2020-01-01
| | | | | | | | | | inside of expr.c. FossilOrigin-Name: 586a65a28fc6cac77309612abc32a2e1017c65e0387f9f438f5d8ac8406da8eb
* | Merge recent enhancements from trunk.drh2019-12-31
|\| | | | | FossilOrigin-Name: 39d55579376906f212271ce9b2d367e3ad029fb173f22c7253312b467970208a
| * Back out the NEVER() from check-in [40d10e7aad5b8992] because it is reachabledrh2019-12-30
| | | | | | | | | | after all. Ticket [892575cdba4e1e36] FossilOrigin-Name: f481636f1a0333c6e98906e5d4433bf1d046380bc29c760e8e7e2c2b3530b956
| * Put a NEVER() on a defensive branch.drh2019-12-30
| | | | | | FossilOrigin-Name: 40d10e7aad5b899206e45d1f8606470a90a07049e15d94c3811cfe695f3a402e
| * In ALTER TABLE, rename columns and tables in expressions that are optimized ↵dan2019-12-30
| | | | | | | | | | out by the "AND 0" optimization. Doing this also fixes an otherwise harmless assert() failure. FossilOrigin-Name: a9e0354c992b0287608ddd18fd35fe7e6102a8f293d6e6e1b3488644bcda8168
| * Convert an assert() back into a conditional. The conditional was converteddrh2019-12-28
| | | | | | | | | | | | | | into an assert() by check-in [6ae4ad6ebee4db88] (2009-05-28) because we were unable to find a test case for it. Yongheng's fuzzer just now found that test case. FossilOrigin-Name: 4d0b9109f7a5312d4e136395e08b11dad64d746bc106ad44d47675e5b1dcb4ef
| * Remove a NEVER() that is no longer true. Fix for [36ffedcb9].dan2019-12-27
| | | | | | FossilOrigin-Name: 597896ed0ae9e2960a8f39576bd7f77a11dccc1da84b6a44ebb5c38d90ebc330