aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
Commit message (Collapse)AuthorAge
* Add ALWAYS() on a branch this is always true now due to [84417bbd144b2197].drh2023-03-21
| | | FossilOrigin-Name: badf7d0e3cfa6efaff4b132cb4ecca79a16e73197c5e275db14ccb5ff938276d
* Disallow the one-pass optimization for DELETE if the WHERE clause containsdrh2023-03-15
| | | | | | | | a subquery. Fix for the problem reported by [forum:/forumpost/e61252062c9d286d|forum post e61252062c9d286d]. This fix is more restrictive than necessary. It could be relaxed if the subquery does not involve the table that is the subject of the DELETE. FossilOrigin-Name: 73f0036f045bf37193b6e87ae45b578c5831614c530488257c69666178da3aa5
* When it is known when preparing a statement that X cannot be NULL, transform ↵dan2023-03-03
| | | | | the expression (X IS NULL) to integer value 1 instead of 'true'. This is because under some circumstances, "Y IS TRUE" may not be equivalent to "Y IS 1". FossilOrigin-Name: cc4bb05b3653e9502b95ea6fe0bfb77feebc11285b66e1dde4c7b945928efbf1
* Improved and simplified logic for resolving the various aliases of the schemadrh2023-02-02
| | | | | table. FossilOrigin-Name: 5c19491c36b9e2128430e4f153bdef48c3f7b6541d44f36044e8fc2921ecc830
* Resolve all possible aliases and variations of the schema table names.drh2023-02-02
| | | FossilOrigin-Name: e7a0112b235d97cb68c92b967bf2218b90258c243ec2b638aaac142392873126
* In expression nodes of type REGISTER with sub-type COLUMN, ensure that thedrh2023-01-13
| | | | | | | iColumn field is set correctly, as otherwise the "IS NULL" operator might be incorrectly optimized. Fix for the problem described by [forum:/forumpost/d010a26798915b53|forum post d010a26798915b53]. FossilOrigin-Name: 0819a1869a39d54a405259ea323365506a182962a02affdef16a03446005da64
* Make use of the sqlite3ExprDeferredDelete() interface in the previousdrh2022-07-20
| | | | | check-in, and in another place where it might be helpful. FossilOrigin-Name: 22f90e9683d5cd6619ccdb06a02e9dde9f4b7457391c0dbb4c3216c22fc0db47
* Simplify the logic that converts the "1" expression in "ORDER BY 1" into adrh2022-07-20
| | | | | copy of the expression that defines the first output column. FossilOrigin-Name: e1f1cfe7f4387b60443bd31742e2f49db1a2d0443200318a898ba0da216619be
* Fix harmless compiler warnings seen with MSVC.mistachkin2022-07-06
| | | FossilOrigin-Name: 61e2094afbbcbd5fdf5c3ec06b96134fafb7b854dc9bfa7d0619bed6d35efbe4
* Allow a HAVING clause on any aggregate query, even if there is no GROUP BYdrh2022-06-21
| | | | | | | clause. This brings SQLite into closer agreement with PostgreSQL and fixes the concern raised by [forum:/forumpost/1a7fea4651|forum post 1a7fea4651]. FossilOrigin-Name: 9322a7c21f1c22ba00e9b889223e89bc1591db6e561ce05091e905e98c1bf2b3
* 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
* Add the ability to access the USING columns of the right or left tablesdrh2022-04-22
| | | | | | of an OUTER JOIN even if the OUTER JOIN is in parentheses. Prototype code only. FossilOrigin-Name: c3a427575fe71de3061495059e253c72c7213e2925ee2873e4f59fc73bfae103
* 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
* Remove an unnecessary assignment operation.drh2022-04-20
| | | FossilOrigin-Name: ed46527aca170ccbe9ed9ea4ae065db72c82dec17da7b99c928fae4495f05c2b
* Improved tracking of nested SELECT objects used to implementdrh2022-04-20
| | | | | parenthensized FROM terms. FossilOrigin-Name: 0da2232624571f4020c05d775ea518514d748fba8dacd4caba2e2e6ed1ae399f
* Add a new comment to the body of lookupName(). No code changes.drh2022-04-20
| | | FossilOrigin-Name: 22fa9b9b450fbbf7578597714eb1094f7d7433ac13497dc7d4a9affc4a2652ad
* Remove unnecessary cases for the resolver.drh2022-04-19
| | | FossilOrigin-Name: 5bc9aa68e2f938f6a70dd4b08703fe52416d17efe461ec65d37332b57b827fdd
* Fix to the coalesce() function generation in the resolver.drh2022-04-18
| | | FossilOrigin-Name: 584bd55e20669d09b7efe3429ba847c42c32fb1eb960784c4e0dedcd96899313
* Fix to the logic that computes coalesc() functions to resolve USING terms.drh2022-04-17
| | | FossilOrigin-Name: 20388548d868511f8c8437718985d75fe9801835811fec716f1700727b9aa367
* Further improvements to USING() processing for RIGHT and FULL JOINs. Alldrh2022-04-17
| | | | | currently known issues are now resolved. Performace is improved. FossilOrigin-Name: 9fd3f22e2228dfba127f6ffe549109f3a4e910fa124adcc9c5483931bd6d5cd7
* New test cases. One of the new test cases shows a flaw in the base designdrh2022-04-16
| | | | | of RIGHT JOIN. FossilOrigin-Name: 4c3ce6475a67b1e207a5b63d9e2d38ee5bc45c899ad00ee327f292bf59039b9c
* RIGHT JOIN USING now appears to work the same as PG-14. Legacy tests pass.drh2022-04-16
| | | FossilOrigin-Name: 5bfb862419541de955dae35fc91f6e9fc70e2744bb786d49fa26bede80b9091d
* Avoid deleting substructure of the Expr node in lookupName() until afterdrh2022-04-15
| | | | | the error message is generated. FossilOrigin-Name: b8e717663957dfd84e580bf21bc8e8881b33fdb94a2cc0c664a230e54d5e5076
* Progress toward a working USING for FULL JOIN.drh2022-04-15
| | | FossilOrigin-Name: fed2646adecb0a05dd674dc1cd2c0ae205078fe552ba93b8d68891c728c67637
* The sqlite3ProcessJoin() routine converts a NATURAL JOIN into a JOIN USING sodrh2022-04-15
| | | | | that henceforth the NATURAL keyword can be ignored. FossilOrigin-Name: 8378e1e0d289627fb294ccd3f5865ef49df3a42b8a5aa211e21be1b42d9da753
* Preliminary code to support RIGHT JOIN. Everything seems to work, except thatdrh2022-04-08
| | | | | | the code to compute the unmatched rows for the RIGHT JOIN has not yet been added, so the result of a RIGHT JOIN is currently the same as an INNER JOIN. FossilOrigin-Name: 415abd6731b8e8a605adabfa6066c8a852a8531c300df41325d5f7e75cae5a70
* Improved technique for parsing the ON and USING clauses of a join is fasterdrh2022-04-07
| | | | | and uses less memory. FossilOrigin-Name: 158156a3e3d50042cafc75dea3aaaa68b1f2efb9c3d178518ea6e68e32e0d21c
* Further improvements to localization of errors in input SQL.drh2022-02-06
| | | FossilOrigin-Name: fa34676042720161ca03f3926814152eb1d144ec12fd2b44e5429408ea4ad5b0
* Enhance sqlite3_error_offset() to report the position of unresolveddrh2022-02-05
| | | | | identifiers. FossilOrigin-Name: 5b8d2577907abda10de29884716bacc10bff0df1451228a0ac40342dbea6d589
* Minor typo fix in comment. No code changes.drh2022-02-03
| | | FossilOrigin-Name: f9b763042c5c4446115c5375a8e4731e522e36ad9fc53e9ef775de9bc297ea19
* Remove many redundant checks for sqlite3.mallocFailed now that any OOM shoulddrh2022-01-24
| | | | | cause Parse.nErr to be non-zero. FossilOrigin-Name: 1f7fa46126ea33ed30e93186aff3df51068aeb4be6f79a102bfe8c4e44941d71
* Ensure that the affinity of columns is honored in the RETURNING clause.drh2021-12-29
| | | | | See [forum:/forumpost/e0c7574ab2|forum post e0c7574ab2] for the bug report. FossilOrigin-Name: 4711fb69547f4f17653ab116030c32fdcc2c836410349d1d025866ffc15704da
* Raise an error if a schema name is attached to the table-alias name of adrh2021-12-24
| | | | | | subquery or view. See [forum:/forumpost/021a33600b|forum post 021a33600b] for the bug report. FossilOrigin-Name: 8af8c153f8c3fe16db1c2280571e005838c4ea3c48929ad7660a1686e49ed255
* 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
* 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
* Dbsqlfuzz (a097eaad43c3c845b236126df92fb49b25449b0c) found a way to reach thedrh2021-09-24
| | | | | | assert() that was added to sqlite3_declare_vtab() by [eb94f4a8174436b1]. This check-in fixes the problem. FossilOrigin-Name: 857d26a68cf439e9cba4f8a3b326c69366fc486a876b76835538709ee39b8713
* 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
* One of the optimizations of check-in [de9c86c9e4cdb34f] does not work fordrh2021-07-22
| | | | | | | | | | terms originating in the ON/USING clause, as demonstrated by [forum:/forumpost/6cf3bb457c3f4685|forum post 6cf3bb457c3f4685]. This check-in disables that optimization for ON/USING terms. Also improve the TreeView display for the resulting "true"/"false" nodes to show that they originate from the ON/USING clause. Add a testcase() to the other optimization to show that it can still be used for ON/USING terms. FossilOrigin-Name: 1f6796044008e6f3a61bcf390c0c7eb31947e971f0edada74e7a3a211f8ae76a
* Minor comment improvements.drh2021-07-16
| | | FossilOrigin-Name: 6854b5919beefa43da21ba739e82d583183c8cdfe5dd63e27a810ac1ffe2330b
* Attempt to omit ORDER BY clauses from FROM-clause subqueries if those ORDER BYdrh2021-07-15
| | | | | | | | | clauses do not affect the output. See [forum:/forumpost/2d76f2bcf65d256a|forum thread 2d76f2bcf65d256a] for discussion. This can help the query flattener in some cases, resulting in faster query plans. The current implemention does not always work. FossilOrigin-Name: ef97c3e7c3ea2cf1a4db6591328fe7ce3f1d189afc2d578159135824ec89e620
* Put ALWAYS() on a branch that is always true due to [d4097364c511709b].drh2021-07-02
| | | | | Fix a testcase precondition associated with the same check-in. FossilOrigin-Name: 55e2fbebb0a2c9991feef46f31e79b82a24de272aae836bf4d3c06ee06ef1a70
* Fix a harmless assertion fault discovered bydrh2021-07-02
| | | | | | | | [https://oss-fuzz.com/testcase-detail/5517690440646656|OSSFuzz]. The assertion fault is harmless because the assert() checks a condition that that is harmless if false and the assert() is disabled in production builds. FossilOrigin-Name: 79443aabe1db8cc2ff9537fde0dac0e858eae3f3848ee9cc1b8fba47b824bf08
* Allow unqualified "rowid" references to be used in join queries, provided ↵dan2021-07-01
| | | | | that only one of the source objects has a rowid. FossilOrigin-Name: d4097364c511709b1874881a0c036640777d1f724165416adf6f53a41f8c6e40
* Fix a problem with running ALTER TABLE against schemas that contain compound ↵dan2021-06-01
| | | | | SELECT statements with ORDER BY clauses containing one or more references to the second or subsequent component SELECT statements. FossilOrigin-Name: 587a3044468a40707c714d013cb766d8a4d9eb13bb20871846a0e8c34bea8cf4
* Fix problems with refering to CTEs from within sub-selects in PARTITION BY ↵dan2021-05-17
| | | | | or ORDER BY clauses of window frame definitions. Also a problem with renaming a column when the schema contains a trigger containing a correlated sub-select within a window frames PARTITION BY or ORDER BY clause. FossilOrigin-Name: 4c6cd54a8db78e5535912e76856bed4f797261aaca4248c69d2e2452194de297
* 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