aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Refactor the Table object to reduce its memory footprint.drh2021-08-02
| | | FossilOrigin-Name: bbb6759bcf6e01d36dfc787a82a610d359f50aaeac8104b73883a84906d54e1f
* Refactor the way that DEFAULT expressions are stored on columns, in orderdrh2021-07-31
| | | | | to save memory in the common case where the column has no DEFAULT clause. FossilOrigin-Name: 8646547e54211d44c415663c33775c4268550f8332949c4731a4bb6ec9cc663a
* Remove ALWAYS() macros that can be true if the internal test functiondrh2021-07-29
| | | | | | | implies_nonnull_row() is used in the result set of a query and contains comparison operator against a computed column. dbsqlfuzz 4c34db5bff6247f33ee49e341a1f3018e72be0a0. FossilOrigin-Name: 4d1dbfa35c7dc0f09321b2e274a00e506f4ca65322454652d5891d815a6966d3
* Fix a recently introduced segfault that might occur if a sub-select were ↵dan2021-07-07
| | | | | used as a term on the RHS of an IN(...) operator for which the LHS is a row-value. FossilOrigin-Name: f586c06a5d03943db32add4d3d058a5aa09c819870b29cd8b54cf69433a8cdb1
* Improve the error message in cases where there is a row-value on the LHS of ↵dan2021-07-07
| | | | | an IN() operator, the RHS is a list (not a sub-select) and at least one element of the list is not a row-value with the correct number of elements. FossilOrigin-Name: 6b22f4e71dbc14c887ebbda67095b5faaa8079cac87cd4ab5a2ae90c71cd9633
* Handle "<vector> IN (<vector>, <vector> ...)" in the same way as "<vector> ↵dan2021-07-06
| | | | | IN (VALUES(<vector>, <vector>, ...)". FossilOrigin-Name: 981d230ece98ce89502dab02aa44f73699a9d0e4fce3e9e9dfd47444a5a9990f
* Improved rebustness in sqlite3ExprListDup() when it contains a vector assignmentdrh2021-07-05
| | | | | | | | from an UPDATE where the initial term is omitted. This can happen during a UNION ALL query flattening while processing a virtual table update in which the first term of the vector is repeated. [forum:/forumpost/16ca0e9f32|Forum post 16ca0e9f32]. FossilOrigin-Name: 2547cfe38f8fb35109b3fc5bdfada387fe4b2b8a304156b704ab7f03f1f71198
* Ensure that TK_SELECT_COLUMN Expr nodes always have their iTable field set todrh2021-07-05
| | | | | | to the number of columns in the vector. This is not strictly necessary. It just simplifies the state description and make the code easier to reason about. FossilOrigin-Name: 026f08d4cff19a95e0f38f2ef431cacd65c7c77ed92e30d7f2ded84651f47150
* Do not enforce the SQLITE_LIMIT_FUNCTION_ARG limit for internally generateddrh2021-06-30
| | | | | | | SQL. This prevents problems with statements like ALTER TABLE if the function argument limit is set too low. [forum:/forumpost/17735aa21f3ddab2|Forum post 17735aa21f3ddab2]. FossilOrigin-Name: 763fdec5b3151eeab001c50e78f654cd9b4b4c10e81e50a663046a70e64d5339
* Fix problems with ALTER TABLE and schemas that contain views with some ↵dan2021-06-11
| | | | | recursive CTEs, or CTEs that reference other CTEs. FossilOrigin-Name: 8b1f9a51e962cd9a5593a1ecf4da6c86e34c4f9ff96ffcea0fb421880c8836cb
* Fix harmless compiler warnings.drh2021-06-04
| | | FossilOrigin-Name: 83aca2d8704e51eeed5652b1506c6fc883c0397728cda456f229369788b8608a
* Fix a case where combining row-value UPDATE FROM syntax with window ↵dan2021-06-03
| | | | | functions over aggregates can cause an error. FossilOrigin-Name: 4a587c3492faa99490fd67ca1de9fceafcdc12d220f42817791923be258b73f1
* 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