aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
Commit message (Collapse)AuthorAge
* Return the error "ambiguous column name: rowid", instead of "no such column: ↵drh2024-03-19
|\ | | | | | | | | rowid", when a "rowid" reference is ambiguous. FossilOrigin-Name: 0615bdae2dfc70c7e0416a28e89ffde31fa44ed4b3dac46e5ef20eed0d89e58c
| * Return the error "ambiguous column name: rowid", instead of "no such column: ↵dan2024-03-19
| | | | | | | | | | rowid", when a "rowid" reference is ambiguous. FossilOrigin-Name: 021f34fcfed41b607be8169bbda59aef93f130108d944f4741b46e8e345b2bbb
* | In the name resolver when SQLITE_ALLOW_ROWID_IN_INDEX is enabled, if theredrh2024-03-19
|/ | | | | | are multiple views that might resolve to the "rowid" but only one real table, then use that one real table and ignore the views. FossilOrigin-Name: 8fcea4cdfc89dd78eca5e7f62aa31aff0e296f41e79349d3af1cc3a2bc4d77c6
* The NOT NULL strength reduction optimization from [de9c86c9e4cdb34f] shoulddrh2024-03-08
| | | | | | | | be applied to the WHERE clause only. Otherwise, the operand of the IS NULL or IS NOT NULL operator might be a reference to a bare column of an aggregate table, and we can't tell if it is NULL or not based only on its NOT NULL attribute. [forum:/forumpost/440f2a2f17|Forum post 440f2a2f17]. FossilOrigin-Name: 51704feae224eff601db5607f8651da11b3c2ed8a58ffe5b6ee8260cab50695b
* If a term of an ORDER BY or GROUP BY contains an aggregate function or column,drh2024-02-11
| | | | | | | then it is not an alias that needs to be resolved, so don't try to. This fixes a harmless assertion found by dbsqlfuzz. This yet another problem that orginated at check-in [6e6b3729e0549de0]. FossilOrigin-Name: d4ec2a5d2297cd9ead0a8768dcf003ea76c74d8d68d88c40f62363f484a4a4d3
* Simplification of the error reporting logic.drh2024-01-22
| | | FossilOrigin-Name: 59eb9d29e796886db17a578b64e75fd2797aebf969cbeeda70ecf2fda378c98f
* Improved error message when a double-quoted string is used and it seems likelydrh2024-01-22
| | | | | that the user wanted a single-quoted string literal. FossilOrigin-Name: 0a834bd81122b6e9c34c8253f9e45d53dab3274be28df60968366fa42237617b
* When unable to resolve an identifier, change the Expr node into TK_NULLdrh2023-12-19
| | | | | | rather than TK_COLUMN, to prevent any downstream misuse of the non-existent column. dbsqlfuzz 71869261db80a95e4733afa10ff5724bf3c78592. FossilOrigin-Name: d2e6117e4f97ab98b01deb5fcad5520f8181d00bed8d904d34963c01d73df857
* Avoid invoking sqlite3ExprColUsage() on an unresolve column reference.drh2023-12-13
| | | | | dbsqlfuzz fc34aa62df4de103705d11b807074687ffafbda5. FossilOrigin-Name: ac9314c0e335694b48c613145f5397247bb88c51806cd0dc3ed4ec306db4bbad
* In the previous check-in, use a u32 instead of an int, to make it easier todrh2023-11-02
| | | | | prove that the integer will never overflow. FossilOrigin-Name: 51002079e0b499e116415189a913a238e95ed9766a8af9d042928f4263861a87
* Fix a spurious "misuse of aggregate function" error that could occur when an ↵dan2023-11-02
| | | | | aggregate function was used within the FROM clause of a sub-select of the select that owns the aggregate. e.g. "SELECT (SELECT x FROM (SELECT sum(t1.a) AS x)) FROM t1". [forum:/forumpost/c9970a37ed | Forum post c9970a37ed]. FossilOrigin-Name: 4470f657d2069972d02a00983252dec1f814d90c0d8d0906e320e955111e8c11
* Fix PRAGMA integrity_check so that it does not raise an error if thedrh2023-10-20
| | | | | | schema contains a CREATE VIRTUAL TABLE that does not have its module loaded. FossilOrigin-Name: 5cb61c6788d7c0170b587e4667ee57d588c991a9901951762e33b97c6a135a82
* Make sure all terms of the ORDER BY within an aggregate go through aggregatedrh2023-10-18
| | | | | analysis. Do not attach an aggregate ORDER BY to a window function. FossilOrigin-Name: 16f3805514a741405f70e0ee3b5a6b67720bc75719372e82daa4136fe411ea2b
* Basic error checking. Resolve symbols in the aggregate ORDER BY expressions.drh2023-10-18
| | | FossilOrigin-Name: c83a53a574d312130d1238c05ffa449d8bed2535d5ef5b5d9cf02f894494cca4
* Add a NEVER() to an unreachable branch.drh2023-09-16
| | | FossilOrigin-Name: 6b6eb38979d68c06e382620c8813d6b67a3de02c4a7a029c84f924b9a2e380c6
* Further tests and assert() statements for the change on this branch.dan2023-09-16
| | | FossilOrigin-Name: 1c202d540ac362bfc747a9f8472e83c9d7614e38467f8b48787a669fb34664ba
* Fix resolution of unqualified "rowid" identifiers in queries with nested joins.dan2023-09-15
| | | FossilOrigin-Name: bbcbd3d537d6790373d97f59386b8ce7fa2177db572af0f1babe058a76e25cc3
* Allow expressions like "<tbl>.rowid" to refer to implicit rowid columns of ↵dan2023-09-15
| | | | | tables in nested FROM clauses. FossilOrigin-Name: 59a1bbc69f5dbb33418fa4b383393fb13a46bc1e531577da8ad54ae2fad5a10e
* Avoid unnecessary NULL pointer checks on calls to sqlite3WalkExpr().drh2023-06-19
| | | FossilOrigin-Name: 73d86a12fb068456a884c030fddd87020d6ec9d56376de541cf082b2104174d3
* Add a C-source spell-checking facility. make misspell (on Nix)larrybr2023-06-07
| | | FossilOrigin-Name: 26c1bb4bd9e9f56613c3aa87407a7f562fd4ebde5bfd6dece02078001d9a45f8
* 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