aboutsummaryrefslogtreecommitdiff
path: root/src/whereexpr.c
Commit message (Collapse)AuthorAge
* Remove an ALWAYS() added by [2567298f4b0fdfeb] because dbsqlfuzz found a waydrh2025-02-01
| | | | | to reach it. The test case was added to TH3. FossilOrigin-Name: d08a7aa8987458a91fcb861d58289e622ba8722936c7874a284f9f2fd782e269
* Tweaks to [4b4f33d791fe4318] to make it easier to test.drh2025-01-31
| | | FossilOrigin-Name: 2567298f4b0fdfeb42aa6bba7e0bec3bc8d0b89bf644a79b41893dd6a6c5774c
* Fix a problem with LIKE and GLOB processing in utf-16be databases in cases ↵dan2025-01-31
| | | | | where the utf-8 encoding of a character ends with the byte 0xBF. FossilOrigin-Name: 4b4f33d791fe4318c4597bee7d2f9e486ed223e731982af470f5cc0dbdc600fc
* Improved handling of unicode characters in the LIKE optimization.drh2024-10-09
| | | | | Follow-up to [bce52ce2a6e7f3d3]. FossilOrigin-Name: 9d0eb3980409115f2f6fd1720a03f34e3968c93be55feafdfef20bf5f711c17f
* Fix handling of U+fffd in the LIKE optimization.drh2024-10-07
| | | | | dbsqlfuzz eee57fb9eea1dfa5aa40dfa87865cf8c84d12f96. FossilOrigin-Name: bce52ce2a6e7f3d3d1b2807d1ea95243d9b655e557c1bb6f0b8a9a6cefb1aed6
* Refactor the SrcItem object to move fields associated with subqueries outdrh2024-08-20
|\ | | | | | | | | | | into a separate object named Subquery. This reduces the size of the SrcItem object by about 1/3rd and provides improved performance. FossilOrigin-Name: 484bcd75bc95491d8540c791c1c4d40d996cb465839564662e14f98739699bf1
| * Refactor the SrcItem object so that information about subqueries is storeddrh2024-08-19
| | | | | | | | | | | | | | | | | | in a separately allocated Subquery object. This reduces the memory requirements for SrcItem and makes the code run faster. It also provides an expansion path for subquery processing that does not burden simple queries. The current checking mostly works, but there are still issues that need to be tracked down and fixed. FossilOrigin-Name: 8ff5dda8448d7e1a533d7f27db2573ce68fa9956b9d9847ced45e83c1f06bab0
| * Give unique names to fields in the SrcItem object, to facilitate analysis ofdrh2024-08-17
| | | | | | | | | | how those fields are used using "grep". FossilOrigin-Name: 9f5aeef3cbc2c95267c8f7bf60d5c66971a76789669fb0e8f853273ff6f616f2
* | When the database encoding is UTF-16LE and the GLOB optimization is used,drh2024-08-20
| | | | | | | | | | | | it is ok to use the range search over an index, but it is not ok to disable the actual GLOB function call. FossilOrigin-Name: 3399698376761ab8c422f8ea02bfa2759afb606f08bedbd1cf7eee834229a9aa
* | Fix for the UTF-16LE problem reporte bydrh2024-08-20
|/ | | | | | | | [forum:/forumpost/dc7e1b7527e84343|forum post dc7e1b7527e84343]. Because of the unexpected ordering of characters using the default collation (memcmp() order) in UTF-16LE, the LIKE/GLOB optimization restricts its attention to the pattern prefix that is all ASCII, which is the common case. FossilOrigin-Name: a5797ebdea423afc3d2d3bd8adaf1575d33a01f594c0c315afcb1499f1718e9b
* Better optimize queries that use parameters in the LIMIT clause.drh2024-06-06
| | | FossilOrigin-Name: e58cb304d1e0ec6e30260a165aaccc2cf096ce6c999efb06683c4ef600ee12ef
* Adjust the parser so that the value of TK_ISNOT is similar to the value ofdrh2024-06-06
| | | | | | TK_IS. This helps the compiler generate faster switch() statements on the Expr.op fields when there are cases for TK_ISNOT and other common operators. FossilOrigin-Name: 34f05c3d89b2dd15e4b0d1ba292df7de3dfc54b505c0ba145cc3db52cf020845
* Small performance optimization in the operatorMask routine of the WHEREdrh2024-06-06
| | | | | clause analysis logic. FossilOrigin-Name: 9d69fc1c87ae673356869ecd89eb19734fd126702c0f9fe595336ecd7be89e08
* Small performance optimization in the allowedOp() routine of the WHEREdrh2024-06-06
| | | | | clause analysis code. FossilOrigin-Name: 4ba8be544711e07748e8dd3ca6b81f9897906061c0a1a1bb4fb3808dc27f734b
* Allow virtual table implementations to handle OFFSET but not LIMIT, but not ↵dan2024-04-26
| | | | | LIMIT but not OFFSET. FossilOrigin-Name: 90e5c8226a695e838e8c1703a9b8598e654d216799e8806c4d1a1f20c28c6486
* Fix a problem allowing a LIMIT constraint to be passed to a virtual table in ↵dan2024-04-26
| | | | | cases where there exist WHERE terms that cannot also be passed. FossilOrigin-Name: 72c8ed9698dd2aadee7b84fd293e8306233f0fe5b5b5731687482444fdf461c7
* Fix handling of LIMIT and OFFSET in virtual tables that are part ofdrh2024-04-26
| | | | | a compound SELECT. FossilOrigin-Name: 40421c1c4ed5bb1ed79ad7ee37cb5a4f0b7864c1eb94abd8ee357ab2202cad30
* Enhance the sqlite3ExprIsConstant() function so that it recognizesdrh2024-03-16
| | | | | | constant functions. So far the enhancement only applies to the multi-row VALUES clause, but it could possibly be applied in many other places. FossilOrigin-Name: c9e0488c6c0135932b6e76b0f3f3acd69ef65327e0a54daa59777f35da1aef26
* Do not allow the query planner to be tricked into thinking that an index on adrh2024-03-07
| | | | | | | constant expression might be useful for something. Problem reported on [forum:/forumpost/ecdfc02339|forum post ecdfc02339]. This is a follow-up to the fixes at [44200596aa943963] and [2d2b91cc0f6fed8c]. FossilOrigin-Name: 720ce06d93a9e4cc25c34c873c82165d8801f208c22701e51538f3210de84f65
* Address various harmless compiler warnings fromdrh2023-06-16
| | | | | [forum:/forumpost/d526da8ee4|forum post d526da8ee4]. FossilOrigin-Name: 365caf2f97e8f15842f52536e8d05d359e9d6e863182e020ce14a9a9f27ee057
* Add a C-source spell-checking facility. make misspell (on Nix)larrybr2023-06-07
| | | FossilOrigin-Name: 26c1bb4bd9e9f56613c3aa87407a7f562fd4ebde5bfd6dece02078001d9a45f8
* Fix a bug in cursor hints that can cause references to tables that have notdrh2023-05-04
| | | | | | | been opened. Cursor hints are intended for use by COMDB2 only and should not appear in production builds, so this should not be a factor for the vast majority of users. FossilOrigin-Name: d3370d59cffb7ab982d6c620c93d22aa6a9dc786e1c4af95ca8d45ff0b9b7d6f
* Further to [46639f682975dac6], the parameters of a table valued function thatdrh2023-02-27
| | | | | | is on the left side of a RIGHT JOIN do not need to be in the ON clause. Add new test cases and tags to associated test cases with the code. FossilOrigin-Name: 18ee689de3d1ae43b05ca52e0b62c49442ebf68a88814a7c679e8856250a4b0d
* When a table-valued function appears as the right table of a RIGHT JOIN,drh2023-02-26
| | | | | | | | the argument constraints on the table-valued function should be considered part of the ON clause of the RIGHT JOIN. Fix for the problem reported by [forum:/forumpost/422e635f3beafbf6|forum post 422e635f3beafbf6]. Test cases in TH3. Possibly related to the enhancement at [501609eddf2a46d5]. FossilOrigin-Name: 46639f682975dac6efec4e230aca2c9b127b4fc77e0b465fad38ef4caa9b7a4c
* Do not allow WHERE clause terms to match constant string index terms, whichdrh2023-02-13
| | | | | | can happen if DQS_DDL is enabled. Follow-up to [44200596aa943963]. dbsqlfuzz 54c9db85ed4af7055f5fd0d50877875c82b11d46. FossilOrigin-Name: 2d2b91cc0f6fed8cb6f738dc7019047ce0f1e86b5eb8efa997095d08a32cbcb6
* Allow vector-IN expressions like "(a, b) IN ( (?,?), (?,?) )" to use an index.dan2023-02-13
| | | FossilOrigin-Name: 1815b15ddb8785a25b7617aab19e13c2410b9377389c16a85176025b3d9400e8
* In the LIKE optimization, do not analyze the new virtual WHERE clause termsdrh2023-02-13
| | | | | | | | until both have been added, since they are expected to be consecutive and the analysis might add complementary terms. This fixes a problem caused by [44200596aa943963] and discovered by dbsqlfuzz and recorded as case 7e3b5983727d843b910b2d9ab556e4afcd777cfb. FossilOrigin-Name: d35de3ad3fac6b30d3f266cbe4b1e9923eb31a1eff4a869205bbc3ba122eeec5
* Do a better job of detecting when a WHERE clause term might be useful todrh2023-02-10
| | | | | | an expression index. Fix for performance regression reported by [forum:/forumpost/e65800d8cb|forum thread e65800d8cb]. FossilOrigin-Name: 44200596aa943963bc6ca98b5d4fd5b9235d1109d8dfc1a75eeae353b4239142
* Ensure that LIMIT clauses may be passed through to virtual table ↵dan2023-01-04
| | | | | implementations even if the WHERE clause uses operators that may only be optimized by virtual, not built-in, tables (!=, functions, MATCH etc.). FossilOrigin-Name: f38caab23bcef1df02618376de22d208a3333d023628cde310345505933329f1
* More frequently send the complete SELECT statement into sqlite3WhereBegin()drh2022-10-22
| | | | | so that it can more accurately determine index coverage. FossilOrigin-Name: f6d09c5a0df940dbaa716df70df28218985b83540b34c468989729a3421ef38c
* This branch attempts to improve the detection of covering indexes. Thisdrh2022-10-22
| | | | | | | first check-in merely improves a parameter name to sqlite3WhereBegin() to be more descriptive of what it contains, and ensures that a subroutine is not inlines so that sqlite3WhereBegin() runs slightly faster. FossilOrigin-Name: cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244
* The generalized indexed expression optimization of [2435112867fbd7b6] makesdrh2022-10-20
| | | | | | the prior [a47efb7c8520a011] enhancement from 2017 obsolete. This check-in removes the older optimization. FossilOrigin-Name: 56442c9bdd7844454c79acf83323380ea3509cb2e0b9a3d538a6b51726ae6d07
* This experimental branch attempts to use columns for an index-on-expressiondrh2022-10-13
| | | | | | in place of the expression that is being indexed. This particular check-in mostly works, but there are still issues. FossilOrigin-Name: 2e8d4fd4cfd9e82f33c707ba246fe2bb3ca01762cf5ac5905058fbc7adf0abe7
* More comment fixes. No changes to code.drh2022-06-22
| | | FossilOrigin-Name: 5c9133ef431a031249760267ca851239d0857ffba633cac27d3865cf179c3274
* Add an ALWAYS() macro to an always-true branch.drh2022-06-20
| | | FossilOrigin-Name: 364645d8fe22491cd566e868027e739464205e892753356016b1988ead207af4
* Do not allow an ON clause to references tables to its right if there is adrh2022-06-20
| | | | | | | | RIGHT or LEFT join anywhere in the query. Other RDBMSes prohibit this always, but SQLite must allow ON clauses to reference tables to their right for legacy compatibility, unless there is a RIGHT or LEFT join someplace in the query, in which case there is no legacy to support. FossilOrigin-Name: e615dbe02ca949252d1526ed5c48f8ce08159773ea2008ce666484379d0d9854
* Avoid a direct use of abort() in debug builds to prevent a compilation issue ↵mistachkin2022-06-02
| | | | | for Windows CE. FossilOrigin-Name: 8eb9a7dd07afc0aef0b7c67054d73e7e821138867d115407b71c985e90d44d59
* Candidate fix for the problem with row-value WHERE clause constraints ondrh2022-06-01
| | | | | a RIGHT JOIN. FossilOrigin-Name: fdd782a7bb217e2aceda97a588c0d7874ee19885abfcf0658472d6c3387da6ee
* When an ON clause on an INNER JOIN references a table to the right ofdrh2022-05-24
| | | | | | | of the join, just convert the ON clause to an ordinary WHERE clause term, in order to be compatible with older versions of SQLite. See [forum:/forumpost/687b0bf563a1d4f1|forum thread 687b0bf563a1d4f1] for details. FossilOrigin-Name: 2b6ebba26d936ae7b9acf7d4bd15e82cbfabda22e1044b3dd838c7b07095100e
* 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
* Make a distinction between (1) WHERE clause constraints, (2) ON/USINGdrh2022-04-11
| | | | | | | | constraints on outer joins, and (3) ON/USING clause constraints on inner joins. Formerly, there was no distinctionb between 1 and 3, but RIGHT JOIN needs to know the difference. Make RIGHT JOIN aware of this difference and add test cases. FossilOrigin-Name: 0f6f61c3664cc87209c2a6f9b6df3a750d1510723fcde209c33db8feaf48bcf3
* Merge the Expr.w.iJoin name change from trunk into the right-join branch.drh2022-04-11
|\ | | | | FossilOrigin-Name: 29927926eb32acd963e2c496ad67d55177615ec4150fd218afaf2f9a730cabec
| * Rename the Expr.w.iRightJoinTable to just Expr.w.iJoin, so that the wordsdrh2022-04-11
| | | | | | | | | | | | "RightJoin" in the former name do not lead readers to believe that this has something to do with RIGHT JOINs in particular. FossilOrigin-Name: e8c00442d2daedec079748d13147bf73b0ec3c3cf432bce2cdccb706bdff2853
* | Merge the sqlite3WhereMalloc() routine from trunk into the right-join branch.drh2022-04-09
|\| | | | | FossilOrigin-Name: b1b3845aa38f469a27f07c8f6e8a98334f7967b19661ee4cf155d6997afd9d4c
| * The sqlite3WhereMalloc() routine allocates memory that is automaticallydrh2022-04-09
| | | | | | | | | | deleted when the corresponding WhereInfo object is destroyed. FossilOrigin-Name: f237e1d8cc41b937f34288daebfacf5f7b0990a807a805e0cb6b45bc730192d6
* | 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
* When create table/view fails due to name taken, say which took it.larrybr2022-02-07
| | | FossilOrigin-Name: 9a206e37fb49a203a7b5fdc93c41acc39e9ceb37144c78432a235e2f0d54a210