aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
Commit message (Collapse)AuthorAge
...
* 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
* Performance optimizations in the code generator, especially in namedrh2021-04-16
| | | | | resolution. FossilOrigin-Name: ab83a99899ceae931b43e0c4b3f8f8b83bc832f1568de5692c0d038c968f8a87
* Add an assert() to show that the SF_Resolved flag does not get set ifdrh2021-04-12
| | | | | errors are being suppressed. FossilOrigin-Name: f455c5b0bda3d303f9269db37efaa8ff0b356622b2df0a7544f83bb334118180
* Fix a segfault that could occur if the ORDER BY clause of a compound SELECT ↵dan2021-04-12
| | | | | contains a sub-select that uses one or more window functions. FossilOrigin-Name: 5ba15ebb34c3af85ef6c54bbb3acb57176d629cda83774881b2a6467e138e904
* Refactor NameContext.nErr into nNcErr to avoid confusion with Parse.nErr.drh2021-04-10
| | | | | | | Do not abandon sqlite3ResolveExprList() on nNcErr if nErr is still zero as we might have hit a problem with ORDER BY resolution that should be a suppressed error. dbsqlfuzz 41b9dad40919d3549ca7e52d893da81a6dded4ad FossilOrigin-Name: 7d674970741bd9b228b818c701c1ae010b90cc287a4c60a872f18b66353d164d
* When resolving names in the RETURNING clause, do not accept trigger namesdrh2021-03-31
| | | | | | even within subquires. See [forum:/info/34c81d83c9177f46|forum post 34c81d83c9177f46] for context. FossilOrigin-Name: fd4ea3f626b6e4957d56c2369be711895735cfc37cfde65650a6682ad5a3eb1a
* When resolving column names in the RETURNING clause, do not ignore andrh2021-03-31
| | | | | | incorrect table name qualifier. Raise an error instead. See [forum:forumpost/85aef8bc01|forum post 85aef8bc01] for context. FossilOrigin-Name: 51d5c50b2fb373e4c7ddb7e26657c26ad39dc9c2fc629bba5c2522b4150d8fac
* Improved comments on the NOT NULL strength reduction optimization.drh2021-03-09
| | | FossilOrigin-Name: a85d72293914b48edbb39171fd591d37ffb09570d8103140a052203ec71d49ee
* Fix another problem with RETURNING clauses in UPDATEs against tables with ↵dan2021-03-05
| | | | | virtual columns. FossilOrigin-Name: f0ef5c76ab1a6568b9148b928277bf589d4cb7033c0acf3e6323879b656d8bd1
* Fix an assert() failure that could be triggered by a correlated sub-query in ↵dan2021-03-05
| | | | | a RETURNING clause. FossilOrigin-Name: 551260c8625828262809b1ef7acf5343a3527b7e167ca0cfd13b81e5ece0e66c
* Put ALWAYS() on a branch that is now always true because of changesdrh2021-03-04
| | | | | in OOM behavior due to check-in [9adf6e2469d18bc3]. FossilOrigin-Name: 8a1bb9c3e92085fb71d75eb36f64eb85053a4730fd314acd401e7ad32c274748
* Fix a segfault that could occur following an OOM condition.dan2021-03-04
| | | FossilOrigin-Name: 9adf6e2469d18bc3bfc0c804cfcaa692e23ab6b3e13465dcfc51c4b111b05cb4
* Fix a problem with using ALTER TABLE commands on database schemas that ↵dan2021-03-03
| | | | | contain expressions of the form "<expr> NOT NULL" or "<expr> IS NULL" that can be evaluated at prepare time. FossilOrigin-Name: d2630ffafa077b8cfd75110b6b73da30f780edc920d2788769a4dc747f09d3f6
* Add #ifndef macros so that the build works again withdrh2021-03-01
| | | | | -DSQLITE_OMIT_AUTHORIZATION and -DSQLITE_OMIT_WINDOWFUNC. FossilOrigin-Name: 9400bdc60294be6a938025d481e50aad9af246e64f38fafecc6ca4f24112a98c
* Attempt to optimize "x IS NULL" and "x IS NOT NULL" expressions when x is a ↵dan2021-02-26
| | | | | column with a NOT NULL constraint. FossilOrigin-Name: 5ecd842555009ce27ee6390325ac5c2504143474b12b730933f0833b3dad788a
* Minor simplification in resolve.c.dan2021-02-26
| | | FossilOrigin-Name: 310dac342e7b1f9b5a5df6a9d598e85d5fef59bba9307d9230baf77c8f2351a2
* 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
* Performance optimization in the resolver.drh2021-02-18
| | | FossilOrigin-Name: 1aafb94d4e3f28a8322e5e43be737d84b1a09f0063408f4a466a6071fa95b39b
* Performance optimization in the code generator for INSERT for the commondrh2021-02-18
| | | | | | case where the target table has neither generated nor hidden columns. Also fix a redundant (and thus unreachable) branch in the resolver. FossilOrigin-Name: 16ac213c57196361a9d14df4c0d1ccc6f67ac522365b345ea364d1aec61fa3f2
* Simplification to the resolveAlias() routine.drh2021-02-16
| | | FossilOrigin-Name: 00bead3931135af80475c22f08cbb26c914518e8f2c7e73c2b8be1cee4ac4d5e
* Correctly detect correlated subqueries when resolving names in RETURNINGdrh2021-02-08
| | | | | clauses. FossilOrigin-Name: b43cfa04922a401442b9d1708e3e4a88d3cfa2c591f9a6b253d99ba83f4b280a
* Improved name resolution for references to a table begin modified fromdrh2021-02-08
| | | | | within a subquery in the RETURNING clause. FossilOrigin-Name: 799d205bfa7945ee4a92dfec5fbf90a00b9a535e3171aab2ec46404f7efb0f78
* Fix the OSSFuzz-discovered shift problem from two days ago. This patch wasdrh2021-02-06
| | | | | | omitted from [078dbff04a95a001] apparently because I made the edit to "sqlite3.c" rather than "resolve.c" where it belongs. FossilOrigin-Name: 864772ffec4e91d8d73f9b97e6e1d7bd4e0537de19d11d30aed7eedd5b7d394a
* Remove unreachable code. Fix a shift UB problem introduced yesterdaydrh2021-02-05
| | | | | and discovered by OSSFuzz. FossilOrigin-Name: 078dbff04a95a001bbd8690ab08038fbb5506899df8290991b53fd1122a4c30c
* Snapshot. New design appears to work on a simple test case.drh2021-02-04
| | | FossilOrigin-Name: 8a65fbeecf3597e30853c5f0ccd9b8b46c508854fa521e58e0db279deebca7d4
* Add an ALWAYS() to an unreachable branch.drh2021-01-30
| | | FossilOrigin-Name: 6bb6de42b62acd35ade6c95a11bb4c9b35e7e9a24620731ae36364c4d5c3bc31
* Working prototype.drh2021-01-29
| | | FossilOrigin-Name: b7ef4dc21f187ff4ff679e823782535188c3814aa6ce720b3a01c6d3ba4ef9f5
* 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
* Correctly handle expressions like "x IS (not) true/false" within the rhs of ↵dan2020-08-24
| | | | | IN() expressions. Fix for [f3ff1472]. FossilOrigin-Name: 493a25949b9a6d0be82169b597133e491d8be4f4147b6eae135b06c1d810abd3
* Fix harmless compiler warnings that surface in newer versions of GCC.drh2020-08-10
| | | FossilOrigin-Name: 9d670a318381f219b467653f5f9539097808b887ae37291ce13be462dedfb18d
* Fix problems that could occur if a table with the same name as the table ↵dan2020-07-15
| | | | | being updated appeared in the FROM clause of an UPDATE statement. FossilOrigin-Name: 13224cbd75990615088f3e30ccba05d31b3099fae4300c9ab8f7663bc5f0eb6f