aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Take care that the code is not generated for the same Select object moredrh2021-05-26
| | | | | | | than once, as transformations that apply during the first pass might cause problems for the second pass. dbsqlfuzz 836b625cd8a41809ef80fc7ebaa6554357bcb463. FossilOrigin-Name: f30fb19ff763a7cbe768ea49954704e14d6400f69bb4257c9c890e1564e14835
* Fix the TreeView module so that it works with the TK_ERROR exprssion.drh2021-05-24
| | | | | Also fix an assert() that was failing due to the recent TK_ERROR addition. FossilOrigin-Name: dd56fbe0cfb0f7848190ce097b378321dd25ae509c7edf93682b091014824fc6
* Additional defenses (above and beyond [b986600520696b0c]) to prevent andrh2021-05-24
| | | | | | | | invalid subquery from causing problems downstream. If an error is found while analyzing a subquery expression, change the expression to TK_ERROR so inhibit further processing on that expression. dbsqlfuzz cf624b8c0484c66e0f552bf6475e3e3f2c22b24e. FossilOrigin-Name: 0be6b6c9f7c562e764792a4a5eb53ed11b230174b19361f7cd7778c743314bbd
* Fix a faulty assert() statement in sqlite3ExprListDup(). This is a continuationdrh2021-05-20
| | | | | of the fix at [59812e7ef705226c]. FossilOrigin-Name: 240f7494bfa3e0806ae2f971e78039c62a419de647cb9e807309f90e1d2a536d
* Back out the EXISTS-to-IN optimization. It slows things down rather thandrh2021-05-04
| | | | | | | | speeds them up depending on the query. And (see [forum:/forumpost/8692d94725|forum post 8692d94725]) it sometimes results in an incorrect answer. We may come back and revisit this optimization later, but for now it seems best just to disable it. FossilOrigin-Name: 16252d73fa73569fd7506676f6ffbbcd43addfb105384fb74449d30ca720904a
* Add ALWAYS() to branches that are no longer reachable due to recentdrh2021-04-26
| | | | | enhancements. FossilOrigin-Name: 63c50fbdeed831ba450d1dce67e968a7daa2b69ac1270eb271fb1e1873d4a07e
* More aggressive detection of OOM errors in resolveAlias().drh2021-04-26
| | | | | dbsqlfuzz 7f96832c2ef7ee472022ed805b064e55e41094b2 FossilOrigin-Name: e99faf4f82746761c389e24db1b00ee94b9f849e7bcb29517fa0ca10290afc41
* Improved OOM detection in sqlite3ExprCheckIN().drh2021-04-23
| | | | | dbsqlfuzz 46ae2d8f473ac672f3042cc14ab67aeab9ffa6c2 FossilOrigin-Name: fac12115a994a1b4347586e68faf38895ee9cb588eaa84c6f71cf9afd4c488b4
* In the sqlite3SelectDup() routine, do not do an incomplete duplication duedrh2021-04-20
| | | | | | to OOM. This in turn requires several new NEVER() and ALWAYS() macros for unreachable branches. FossilOrigin-Name: a61c0e6b78bd39f55464fafd257e68effded64995a66e8fa2d686e8c507ebe43
* Performance optimizations in the code generator, especially in namedrh2021-04-16
| | | | | resolution. FossilOrigin-Name: ab83a99899ceae931b43e0c4b3f8f8b83bc832f1568de5692c0d038c968f8a87
* Remove an ALWAYS() from a branch in sqlite3ExprAddCollateToken() which candrh2021-04-16
| | | | | | be false following an OOM. dbsqlfuzz 9e8516bf1e786c84e520ae43141b75b7399f8618. FossilOrigin-Name: 6af4e6d054efd8445e1010aabd584f36e70dfad0de13bd0e2f1761cad4d9a7d6
* Fix an assert() in the code generator for expressions so that it is validdrh2021-04-14
| | | | | even after an OOM. FossilOrigin-Name: 427e83eb583a4f63650912f078122e7373fe8c7ea11acfdab464d748b4235261
* 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