aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Further improvements to localization of errors in input SQL.drh2022-02-06
| | | FossilOrigin-Name: fa34676042720161ca03f3926814152eb1d144ec12fd2b44e5429408ea4ad5b0
* Fix various harmless compiler warnings.drh2022-02-04
| | | FossilOrigin-Name: 70049342d5ad57ea3e863bba19253934b868bacdd1c26c9371bac024a829badf
* One of the ALWAYS() macros in the previous check-in could sometimes bedrh2022-01-24
| | | | | false, following an OOM. Remove it. Problem found by dbsqlfuzz. FossilOrigin-Name: 11df9187dad0eb33b0f6288b76d74f9700420ec855e8106b0bc71df48c485ad1
* Add ALWAYS() macros. Change some existing ALWAYS() into assert(). Otherdrh2022-01-24
| | | | | code simplifications. FossilOrigin-Name: 4aa27b4fcd1ffd06c38357a87ba3f5776367570439c49652f0903873def0bb23
* Remove many redundant checks for sqlite3.mallocFailed now that any OOM shoulddrh2022-01-24
| | | | | cause Parse.nErr to be non-zero. FossilOrigin-Name: 1f7fa46126ea33ed30e93186aff3df51068aeb4be6f79a102bfe8c4e44941d71
* Following a prior error, an ALWAYS() in sqlite3ExprCanBeNull() might be false.drh2021-11-28
| | | | | dbsqlfuzz 5dbec6678a20e7595a34dfdd869a3b9722b3ca43. FossilOrigin-Name: 4e207401acce1bdc17025f2d55bd94234b435e286cd43e1eda03b6949a2a91d3
* Improved defenses against integer overflow when computing the size of adrh2021-11-26
| | | | | | memory allocations. No bugs were fixed here. But perhaps future bugs will be prevented. FossilOrigin-Name: eb878c01f317f09e8ef6b1bd2ec8d6d5cd6ce0bdfe9da7fa7d92d2047cc9d9e4
* Small performance increase and size reduction for sqlite3ExprCompare().drh2021-11-19
| | | | | This change also handles some corner cases without the need for ALWAYS(). FossilOrigin-Name: d814ba6effc7c5b021ff625b57371627f3ee326687c508da99f78bc164386b7e
* Improved handling of OOM while reallocating a column name to add typedrh2021-11-12
| | | | | information. dbsqlfuzz 5a195b4233649e49e0aa34f1b743ca192d85b198 FossilOrigin-Name: 5995dd4de4997c43b43befc1281ef6378f33f781134c7f368299d64db2344f1d
* Refactor the code that figures out which SELECT in a cascade of nested queriesdrh2021-11-08
| | | | | | | a particular aggregate function belongs to. This fixes the problem reported by [forum:/forumpost/c7cc2aa3546e39c1|forum post c7cc2aa3546e39c1]. New test cases in dbsqlfuzz and th3. FossilOrigin-Name: 74aec5dd1df95b5635f4da1f13753f113ea1d61de3dc3a1523ba51089c1900e4
* Ensure that the window function rewrite does not leave the parse treedrh2021-11-07
| | | | | | | | | in an invalid state that might cause problems downstream before the error is recognized and unwinds the stack. Also take steps such that an invalid parse tree does not cause problems even if it goes unrecognized. [forum:/forumpost/398e9d5aa9|Forum post 398e9d5aa9]. FossilOrigin-Name: 0f9fc6b6073365d5159cd71e7fe08f8dadbc7b42abd324361e809502f4359155
* Fix the build for various the OMIT-everything compile-time option. No impactdrh2021-10-27
| | | | | on regular builds. FossilOrigin-Name: 947805719bc8629619af5358ad50a6365c01f8d9ceabfe8e4df947696d3819b3
* Protect access to the Expr.y union using nearby assert()s and branches.drh2021-10-07
| | | FossilOrigin-Name: 87e2f5eb436fc448427b0e24fb70f29688796b513b8c7b12f1a21540dae1e56d
* Protect all accesses to the Expr.x union using nearby assert()s and branches.drh2021-10-07
| | | FossilOrigin-Name: 8eaa1d4a98b24adf245bbd2fe9212aa6a924a0f09c445906d7f87574f36a7423
* Protect all accesses to the FuncDef.u and Expr.u unions using nearbydrh2021-10-07
| | | | | assert()s or branches. FossilOrigin-Name: 9af863f065e0bef491c2ab7525194505f9516f4e6dfc789d2e3a9d2c2438533a
* Fix harmless static-analyzer warnings.drh2021-10-04
| | | FossilOrigin-Name: 32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
* Fix harmless static analyzer warnings.drh2021-10-04
| | | FossilOrigin-Name: 1ebcde72e2046dffaa408d2a5a4a5bbf35fdf4b096e0e088dcffd9360effdaa7
* Fix a harmless static-analyzer warning in sqlite3ExprCode().drh2021-10-02
| | | FossilOrigin-Name: 918c22e82ae6e366ddd094d337ed73fd23878c51745045519ed700113832545c
* Fix another problem with ALTER TABLE and vector UPDATE statements within ↵dan2021-09-29
| | | | | triggers. FossilOrigin-Name: a0df216f7c3f8963efba0b1ffee65d6a63309d846ffdcf2d2932cb4f1d4967b7
* Improved testability of changes from check-in [255b0eeed113d83b].drh2021-09-29
| | | FossilOrigin-Name: bbfd083c26086fb103fec88faa59a01e689e0b7fce38c09d8846bb472a0e6760
* Fix a problem in ALTER TABLE causing table or column references in ↵dan2021-09-27
| | | | | sub-selects ton the RHS of a vector SET clause in an UPDATE within a trigger (i.e. "SET (a,b) = ( (SELECT...), <expr> )"). FossilOrigin-Name: 255b0eeed113d83b474efc5bc8fc790a270bc43ee598df4b2c378e1ad2d729b7
* Add const to parameters on various internal interfaces.drh2021-09-25
| | | FossilOrigin-Name: 70c221c5cf7b4d9ed34f16d045f262f99d16aa3db84f80cf0b03ee82ba28d075
* Add lots of new "const" on internal function parameters. There is opportunitydrh2021-09-24
| | | | | for many more - this is a work in progress. FossilOrigin-Name: a3c71a673ddd1c299bdae550fb955077b77088329a8ca2895dfb23538b524a8e
* Make the affinity() function available even if compiled withoutdrh2021-09-17
| | | | | | SQLITE_DEBUG. Surround the implementation of all test-only SQL functions with #ifndef SQLITE_UNTESTABLE. FossilOrigin-Name: b7e00ef8059f6fb5658c6ad6f337cfdf065a5f1b1130452122282f3a69e98a93
* Store the collating sequence name for each column of a table as andrh2021-08-05
| | | | | | extension to the column name, for an additional savings in the heap space needed to hold the schema. FossilOrigin-Name: 832ac4c1ee384be0de72a4bdd55ed87e0f8294e7df5eefcf6b4942db3d85a69e
* Refactor field names in the Column object, zCnName and zCnColl, to make themdrh2021-08-02
| | | | | unique and thus easier to find amid all the other code. FossilOrigin-Name: 8b781dcaf68e0cf12a844708c82eee00193e340195cbca915d077e4846983bf3
* 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