aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Fix a faulty assert() inside sqlite3ExprDup().drh2021-04-12
| | | FossilOrigin-Name: 59812e7ef705226c801f95ec7f78cc931f9957ffb66715607d63874813b280cb
* Earlier detection and handling of OOM problems.drh2021-04-06
| | | | | dbsqlfuzz 39f2963ea5559aa3a16e24e0e3cb42aac85a7371. FossilOrigin-Name: 8d46df73132e46abb32b9dc129b6beb978d34dac3d372fb004ca283b0832d04c
* Make shell .parameter feature type-agnostic. Hush harmless compiler warning.larrybr2021-04-04
| | | FossilOrigin-Name: 35cf295e026d067c9f059fde6b150e65163fe171d37501eb1e5742e691793340
* Defer deletion of expressions that are optimized out by the AND optimizerdrh2021-03-31
| | | | | | | | | in the sqlite3ExprAnd() routine until the corresponding Parse object is deleted. This avoids a dangling pointer in AggInfo if sqlite3ExprAnd() is invoked by the push-down optimization. The dangling pointer appears to be harmless in release builds, only showing up in debug builds. Problem found by dbsqlfuzz. FossilOrigin-Name: c36b43589abd9f62a709bdb47b8748e0c1e8743487a3d83d1eb35eb06b65d763
* Fix VDBE coverage macros.drh2021-03-29
| | | FossilOrigin-Name: ebe100de55ccdf6abccde5d8e6e96099b6e8dc3527f1441265e2b86b6661a66b
* Omit the SQLITE_STOREP2 and SQLITE_KEEPNULL options from the comparisondrh2021-03-29
| | | | | | | opcodes, allowing them to run faster. This required refactoring the vector comparison logic, which in turn required changing OP_ElseNotEq into OP_ElseEq. FossilOrigin-Name: 380b46054b6a9b67e57357815e8e94057253fa3cce838ae76e5d5031c6bd26b2
* Add the OP_ZeroOrNull opcode and use it to compute boolean values fordrh2021-03-29
| | | | | | scalar comparisons, rather than the SQLITE_STOREP2 parameter to the comparison opcode. FossilOrigin-Name: 93781b6f10a94fb273204b95156a8b90e07071f28c89e7966c659a0f44f60e98
* Add the ExprList.nAlloc column and use it to make the sqlite3ExprListAppend()drh2021-03-23
| | | | | routine much faster. FossilOrigin-Name: 1d3c4662c2f522ac695d97441324069f3fc65f3fa0b87194c7094dfb8cd549f2
* Dbsqlfuzz found a new way to make that branch in codeVectorComparedrh2021-03-19
| | | | | reachable. FossilOrigin-Name: 959272c27555e39f180d46257afe45d41da1f5df38ea269196c06741ff6a278e
* Restore the NEVER() that was taken out by [f481636f1a0333c6] because thatdrh2021-03-19
| | | | | case is no longer reachable after the previous check-in. FossilOrigin-Name: e3a78b2a237a2e101faf01dde913f63641da8854720a9daa4b45a9c5dfe30b1b
* Do not confuse the constant SQLITE_MAX_ATTACHED with the maximum number ofdrh2021-03-10
| | | | | | schemas. Add the new SQLITE_MAX_DB constant for the maximum number of schemas. [forum:/forumpost/a006d86f72|Forum post a006d86f72]. FossilOrigin-Name: 7b65fb9f7bd616f834633afd64b3448bf9ca2b6e4cc6d6c01e75d1d877c88a79
* Materialize any CTE that is used more than once.drh2021-02-21
| | | FossilOrigin-Name: ba59159fbe6b83fb6d79fbfee22d983768b0ebbaac7e99d2ac66c810e5e04100
* Rename the "struct SrcList_item" object to the more succinct "SrcItem".drh2021-02-21
| | | | | This is a symbolic change only. The logic is unmodified. FossilOrigin-Name: bfd5bf2c73110fcb36db9ba2a949ff516131fbd3e89325f88fe9f5c2b4ed87b2
* Improved handling of vector equalities in the EXISTS-to-IN translator.drh2021-01-16
| | | FossilOrigin-Name: ef49ee4a3766146963bfb6b013472f9836afb9c5b0d21a8533871cf961139e38
* Use NEVER and ALWAYS macros to confirm that the return value fromdrh2020-11-08
| | | | | sqlite3ExprSkipCollateAndLikely() is never NULL in some of its use cases. FossilOrigin-Name: 76d2eb86e109fc3cbdba2e8175c22ed7660b59bb9315f6c55c565587f33ad43b
* Fix a faulty assert() statement. Add new test cases.drh2020-10-02
| | | FossilOrigin-Name: 80ecdb3da4558bb08ee3ec6edbde906ad5b3b8182e672b5ba0d5dfa8041cee0a
* Fix a crash that could occur in SQLITE_MAX_EXPR_DEPTH=0 builds when ↵dan2020-08-20
| | | | | processing SQL containing syntax errors. FossilOrigin-Name: 5f58dd3a19605b6f49b4364fa29892502eff35f12a7693a8694100e1844711ea
* Do not skip over TK_IF_NULL_ROW operators when bypassing TK_COLLATE operators.drh2020-08-19
| | | | | | Fix to check-in [ac31edd3eeafcef4] which was itself a fix for ticket [45f4bf4eb4ffd788]. FossilOrigin-Name: 871f2ddcfbb9196dbd851a350e3471ee6d242d86bbd755201f7e2406fce3ac55
* Fix harmless compiler warnings that surface in newer versions of GCC.drh2020-08-10
| | | FossilOrigin-Name: 9d670a318381f219b467653f5f9539097808b887ae37291ce13be462dedfb18d
* Readd the ALWAYS() macro that was removed by [f7a74f89dbd58b47] as thedrh2020-07-13
| | | | | condition is no longer reachable due to the previous check-in. FossilOrigin-Name: 9cb03beae42d814a1b1b69f72865fde502d3f443313ec29edd010d1de40225eb
* Remove unnecessary code from the window functions implementation.drh2020-07-10
| | | FossilOrigin-Name: 1e87da9c93309d1d69b1e0ab65c615b9ff9c1c6813ad0c7b90d2495be4ba0adc
* Fix a possible null pointer deref following OOM. Discovered by dbsqlfuzz.drh2020-06-26
| | | FossilOrigin-Name: cc888878ea8d5bc754c69de523819d32d6d9853857e31d7287f9dbfd723428db
* Further refactoring of the schema table name.drh2020-06-19
| | | FossilOrigin-Name: 9536fa0ae0c1ae6e2e98d2fa11e5acda7f3c9b8ca5061b6f7f8cae63a11d936b
* Identifiers "TRUE" and "FALSE" cannot take on their boolean constant values ifdrh2020-06-13
| | | | | they are operands of the "." operator. FossilOrigin-Name: ad738286e2441b5e84d05366db3fcafabe66be766f21fe6c17f43a8fabab16fb
* Mark an always-true conditional with ALWAYS().drh2020-06-09
| | | FossilOrigin-Name: 35a236841764a10cdcda63f34e1a8e7ffa43933bc89cb32f675454327834d7bf
* Ensure that aggregate functions that (a) are part of SELECT statements with ↵dan2020-06-09
| | | | | no FROM clause and (b) have one or more scalar sub-selects as arguments are assigned to the correct aggregate context. FossilOrigin-Name: 16a41fa8c4c74bba4e908a9c19e6cf5a927cac140e2070c9abf303158be7257b
* 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