aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Walk back the optimization from check-in [cc458317bd77046c] that tries todrh2022-05-13
| | | | | | | reuse the same ephemeral cursor of a list subquery when that subquery is reused, as it does not work in cases where the list subquery is used both for lookups and for scans. FossilOrigin-Name: 12ee29d632ae4b585ef6bc07d3289d00c121268945dffd5673b251d95874e3f8
* Redefine the acccess rules for the Expr.w union so that the Expr.w.iJoindrh2022-05-13
| | | | | member is accessible on either EP_OuterON or EP_InnerON. FossilOrigin-Name: 6f741d6cfb8831a3ac966257ac4519bcc8156293447bf50323c2d9b170125974
* Improved names for flags on the Expr object: EP_FromJoin becamesdrh2022-05-13
| | | | | EP_OuterON and EP_InnerJoin becomes EP_InnerON. FossilOrigin-Name: 1ffea07ff98b894729c698b681cc7433df3bbfccd8a0529a706908602a636937
* Organize the various flag bits of the ExprList_item object into a substructuredrh2022-05-02
| | | | | so that the whole lot can be copied all at once. Faster and smaller code. FossilOrigin-Name: 5341d4bbe9a943f9cdbbdea829e18f108e98972ebb706396c50fc62fcc6a6328
* Name resolution and "*" wildcard expansion for parenthesized FROM clausesdrh2022-05-02
| | | | | | seems to work the same as PG. The code is chaos, however, and needs some cleanup. FossilOrigin-Name: 6f9c0b07aadc5189c65c3ee4e6938aac10fc0d98f1cb06980f5e5d7b0308f237
* Merge the latest trunk fixes and enhancements into the right-join branch.drh2022-05-02
|\ | | | | FossilOrigin-Name: afbcf075c1e09ae064c7b16e63501cd1d374711812664aef76bd35d02d64a2b6
| * Improvement on check-in [a193749730d6cfba] so that the subroutine call todrh2022-05-02
| | | | | | | | | | | | the IN operator right-hand side generator from the RIGHT JOIN no-match logic does not generate unreachable byte code. FossilOrigin-Name: cc458317bd77046c4328715ae9e3409f3f4cd422a01162cb33405ef3a142b0a3
| * Bring the comments on sqlite3FindInIndex() into closer alignment with whatdrh2022-05-02
| | | | | | | | | | that routine actually does. FossilOrigin-Name: 40f3274745b53bb72933c1052d0e85bc74be56d3a1068e9d54dc28763a2cfef9
* | Merge trunk enhancements into the right-join branch.drh2022-04-28
|\| | | | | FossilOrigin-Name: 3fd9706bba4a71cb5c7ce1341c3be0a7727941445820a073e7b2f0f32512e8ef
| * Fix a harmless typo in a comment.drh2022-04-27
| | | | | | FossilOrigin-Name: e1f4a115df34e45cf1bcf98961c699b582f564a58a979e95853b219bda06212c
| * Fix a problem with automatic indexes introduced bydrh2022-04-25
| | | | | | | | | | | | check-in [664b461bb5063d980] and reported by [forum:/forumpost/0d3200f4f3bcd3a3|forum post 0d3200f4f3bcd3a3]. FossilOrigin-Name: 7ca3456c00998a429418ff29cf251b381586b330b88344c94a40c5df0b71da85
* | Fix minor problems with the new join table name resolution logic.drh2022-04-23
|/ | | FossilOrigin-Name: 3a6b0db4519072dbd41b1c105bf1a0c6b4dd90380e94a5662645d8d41483c707
* 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