aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Honor the MATERIALIZED keyword on a common table expression by not flatteningdrh2022-04-22
| | | | | the CTE into an outer query. FossilOrigin-Name: 8d631a6b9eb06b54b10eda595a4c588ca38f909b4afa653b24d1f720b55d72f7
* Avoid materializing columns of SF_NestedFrom subqueries that are never used.drh2022-04-21
| | | | | Other code improvements manually imported from the right-join-paren branch. FossilOrigin-Name: cd8272fc2a34d1b245fd95208b9b601266ee7d2ff0f5ce52d03752f2c4e852a2
* Improved comment field in the bytecode generated for OP_Column and OP_Rowid.drh2022-04-18
| | | FossilOrigin-Name: 009bbf8026106c5a74cced06cced48badb870a4b6e6a2f8104a544d2a8d79e45
* Change OP_Return such that if P3 is 1, the Return is a no-op when thedrh2022-04-17
| | | | | P1 register contains a NULL. FossilOrigin-Name: c90602328a4b26f06d76c5343d29ebb7a782186c86ea88f5965a41040cff5346
* Enhance the IdList object to exist in a single memory allocation (rather thandrh2022-04-15
| | | | | | a separate allocate for the base object and the array of IDs). Also permit an IdList object to store an Expr pointer together with each name. FossilOrigin-Name: 40f3c95871e6f40f287ef2756abafb8fc56dffdd0af69436e5c7d8e95022d94e
* Another instance of indenting a subroutine.drh2022-04-14
| | | FossilOrigin-Name: 73f4036b04798660b30e540cbab69420078df9fb62a6a39944e078c36272f905
* Rerun the subroutines that compute row-values if necessary from withindrh2022-04-14
| | | | | the RIGHT JOIN body subroutine. FossilOrigin-Name: 9b9038bcd0ab5c4f01661456635526cef764f854ff24018a5e6e43825d07eb59
* Adjust the output formatting of bytecode listings so that subroutines useddrh2022-04-14
| | | | | to implement subqueries are indented one level. FossilOrigin-Name: 079b7b125206fb295720612f4853a5b786ec431ab595d35407195844779c149d
* Fix some comments that refer to LEFT JOIN that should refer to OUTER JOIN.drh2022-04-11
| | | | | No changes to code. FossilOrigin-Name: 5be5ede5cca1cd5ef863fe0feb2b4a990f4a42865281a6c2e4eb816f48847dc6
* Improved technique for parsing the ON and USING clauses of a join is fasterdrh2022-04-07
| | | | | and uses less memory. FossilOrigin-Name: 158156a3e3d50042cafc75dea3aaaa68b1f2efb9c3d178518ea6e68e32e0d21c
* Add the new OP_BeginSubrtn opcode (which is really an alias for OP_Integer)drh2022-03-03
| | | | | | and make other changes so that the span of a subroutine that implements a subquery is more readily apparent in bytecode listings. FossilOrigin-Name: b8226748709de37cfc86414714c20567254e5b320b380e767c322dba69a79d49
* Faster computation of Expr.nHeight.drh2022-02-06
| | | FossilOrigin-Name: a7a5af327ba8bafcd58b828e3e7a10d0008bb780d55a6c573aa15896dcc8ab89
* 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