aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* | ORDER BY on aggregates seem to work, at least for simple smoke tests. Lotsdrh2023-10-18
| | | | | | | | | | more testing is needed though. Surely there are many bugs. FossilOrigin-Name: 64c12a835b6f1df8f2f5f4a41de083f6b3fc7f8030042c6aac0082382cd9cc4d
* | Basic error checking. Resolve symbols in the aggregate ORDER BY expressions.drh2023-10-18
| | | | | | FossilOrigin-Name: c83a53a574d312130d1238c05ffa449d8bed2535d5ef5b5d9cf02f894494cca4
* | Enhance the parser so that it can accept an ORDER BY clause on a functiondrh2023-10-18
|/ | | | | | invocation. For this incremental check-in, the ORDER BY clause is currently ignored. FossilOrigin-Name: 3a98ff24bf468ed42d410a9a12d9f9b2ca154c7babe99fd6bc6f7b0565e0d132
* Change the order of an if..else... in new code to make it slightly faster.dan2023-09-25
| | | FossilOrigin-Name: f80dc64483a54a488e507da140836261ae1b864577cc95d8e869919d5a25e73c
* Fix a harmless compiler warning.drh2023-09-23
| | | FossilOrigin-Name: 7c4210253b660b385d14de3ae7ab30f038036308e1164ec17b40e2805b9b2235
* In partial index scans, if the WHERE clause implies a constant value for a ↵dan2023-09-22
| | | | | table column, replace occurences of that table column with the constant. This increases the likelihood of the partial index being a covering index. FossilOrigin-Name: 66ed7abdfa228abde2052e3988589371f0e49b11582b1b4a83255d2df3a0aefa
* Allow expressions like "<tbl>.rowid" to refer to implicit rowid columns of ↵dan2023-09-15
| | | | | tables in nested FROM clauses. FossilOrigin-Name: 59a1bbc69f5dbb33418fa4b383393fb13a46bc1e531577da8ad54ae2fad5a10e
* Remove out-of-date comment regarding use of Parse.pConstExpr.dan2023-09-09
| | | FossilOrigin-Name: 71548f72ad578db3d6ee409956386ace23ab2258d37cdc29ef2fb126e48f1ee3
* Changes so that sqlite3_vtab_nochange() works with "UPDATE ... FROM...". Use ↵dan2023-08-07
| | | | | this to allow UPDATE on a contentless fts5 table if new values are supplied for all indexed columns. FossilOrigin-Name: 16cd2161e312cf97129011fc829079db8f762b822b2f4fabf7ff6742c071302f
* Multiple optimizations that try to preserve or infer the zero-terminateddrh2023-07-21
| | | | | | | property of TEXT values. Avoid unnecessary copying of text values destined to become function parameters. All changes help improve performance of doing UPDATEs on large JSON values that are indexed multiple ways. FossilOrigin-Name: d0278cdedfa04fb0b61838ab9622be8a2c462f58d5c3ebc4c5f802a727d0974e
* Optimize the argument to the octet_length() function so that it does notdrh2023-06-22
| | | | | attempt to read content from disk. FossilOrigin-Name: 8b8ea4e3f52d96cc217bd1fb27ca4a83489ef1f250756ed2f790d1b0ee529a3a
* Address various harmless compiler warnings fromdrh2023-06-16
| | | | | [forum:/forumpost/d526da8ee4|forum post d526da8ee4]. FossilOrigin-Name: 365caf2f97e8f15842f52536e8d05d359e9d6e863182e020ce14a9a9f27ee057
* Improved sqlite3_error_offset() values for bare column errors on '*' anddrh2023-06-13
| | | | | 'table.*' expressions in SELECT statements. FossilOrigin-Name: 118fe600876686273f85d0a080a21267e83c11826365f3220336b1bd39562518
* Fix straggler misspellings and tidy the custom dictionary. Also include ↵larrybr2023-06-07
|\ | | | | | | | | pickups from [forum:/info/c61fb09afd|forum post c61fb09afd]. FossilOrigin-Name: 8c291d99946eb32b20b743921202f9c7cfb716268ff526817b27adbb7942e40b
* | Add a C-source spell-checking facility. make misspell (on Nix)larrybr2023-06-07
|/ | | FossilOrigin-Name: 26c1bb4bd9e9f56613c3aa87407a7f562fd4ebde5bfd6dece02078001d9a45f8
* Restore the LEFT JOIN strength reduction that was partially lost indrh2023-06-02
| | | | | [d747afda5683ca5f] when strength reduction was generalized to all OUTER JOINs. FossilOrigin-Name: 2d962b84dd8ac2d0968f0283f8f082c1c2a7a1f99b59053b2ad8f58745396447
* Fix the OUTER JOIN strength reduction theorem prover's handling of the CASEdrh2023-06-02
| | | | | operator. FossilOrigin-Name: 73d7b14b1713d93c4ae07995e9aa6485cbad90bd6125584dbaeccb0cc9410ea3
* Generalize the LEFT JOIN strength reduction optimization so that it works fordrh2023-06-01
| | | | | | RIGHT and FULL JOIN as well. Rename it to the "OUTER JOIN strength reduction" optimization. FossilOrigin-Name: d747afda5683ca5feb92866a14ccc4c5127d3378ece5cad2c3da819f2477b457
* Add an ALWAYS() on an unreachable branch.drh2023-06-01
| | | FossilOrigin-Name: a00928d48061c1169d5564996e19e7d7c2b962842100bb119846d0f696123c23
* Fix the LEFT JOIN strength reduction for IN operators in the WHERE clause.drh2023-06-01
| | | | | Further simplifications and refinement of the algorithm. FossilOrigin-Name: 96c72dde79d4069f6c2f81467a35b617633f86f7a7dcafbda991affdaa1f8537
* Add a comment to explain why both sides of an AND must be non-null-row in orderdrh2023-05-31
| | | | | for the overall expression to be non-null-row. No code changes. FossilOrigin-Name: 8396032ce14a75f408f0a75bcb36a6504d5188f20886e275746a2c336a74296f
* Improved detection of when the LEFT JOIN strength reduction optimizationdrh2023-05-31
| | | | | can be applied. FossilOrigin-Name: f544a8e47cdd5ad7233887a558489983f4f305a39391ff463c43e2e4157da087
* Avoid performing aggregate processing more than once for a single ↵dan2023-05-23
| | | | | expression. [forum:/info/36ff78b2a3|Forum post 36ff78b2a3]. FossilOrigin-Name: 367b4cc549a14222d54530538e692e9d1a365002c1b8c4ef80ddc0523bfdb3a2
* New assert() statements to verify that Expr.iColumn is never used as andrh2023-05-17
| | | | | array index when its value is negative. FossilOrigin-Name: 6084c5fb6d3fcedf35cd6c597a44ec7bf8b4a2576c7b277e5342d2a7905318e7
* Fix two assert() statements that failed to take into accountdrh2023-05-17
| | | | | the likely() built-in function. This does not impact production code. FossilOrigin-Name: 8504fe812c5b4956c8acad515d537add54cb591bc81747113f9b24526d7685b8
* As evidenced by [forum:/forumpost/f3f546025a|forum post f3f546025a], thedrh2023-05-15
| | | | | | | | | new RIGHT JOIN related restriction on the push-down optimization implemented by [da3fba18742b6e0b] also needs to apply to the automatic index (a.k.a. hash-join) optimization and to the Bloom filter optimization. Computation of the restriction is now moved into the sqlite3ExprIsSingleTableConstraint() routine. FossilOrigin-Name: 4902015dcf3869f08d9986e422faa231d9218a5e0fc59ba8df0f407e4eb3d605
* Remove a stray CR from end of line in a source file.drh2023-05-12
| | | FossilOrigin-Name: 48139fb904de4b7b383e7f8c29bed83ad878eb22b1dd773c366a0aee74613d23
* Rename sqlite3IsTableConstraint() to sqlite3IsSingleTableConstraint() anddrh2023-05-10
| | | | | | improve its header comment, in an attempt to make the code easier to reason about. No functional changes - should generate identical machine code. FossilOrigin-Name: 5dae897431a0a9dbb354c4a8a48f935ea7438035d96f90b83dd81eae434c8277
* Do not apply the "AND false" optimization if either operand comes from thedrh2023-05-01
| | | | | | ON clause of a join. Fix for the problem identified by [forum:/forumpost/96cd4a7e9e|forum post 96cd4a7e9e]. FossilOrigin-Name: d095da0e7a24e3bcab6495d964f76a86d7a5910d2d6edddc6e8092bfa6084fe6
* Fix a code-generator issue associated with very unusual use of windowdrh2023-04-13
| | | | | | | functions. Both the expr.c or the window.c changes will each independently fix the problem. They are both included in this patch for defense in depth. [forum:/forumpost/0d48347967|Forum post 0d48347967]. FossilOrigin-Name: 1ba22631a7831e3562eda0eb6a5edf7f009c85c7ab4451d9eacd13ef0fb6036a
* Remove an ALWAYS() that can sometimes be false. Add a test case that makesdrh2023-04-11
| | | | | the test false. FossilOrigin-Name: c8fb143d64d8e823684cd26799080da4b42bef121ca3c6315b1803a593490926
* Fix a harmless compiler warning.drh2023-04-08
| | | FossilOrigin-Name: c9559ba62191fe7fa2a718233afaa841e2594d1fc833314bf5b0a6b775e87c35
* Work around a harmless assertion fault associated withdrh2023-04-06
| | | | | | | | | sqlite3VdbeMemAboutToChange() such that the detection of stale values in registers is preserved in debugging builds, but we avoid a false-positive assertion fault in cases involving a virtual table with a LIMIT clause in an IN-operator loop. dbsqlfuzz 3fd70d4ab4950acf1deb8f610a7a7c67cd38713b FossilOrigin-Name: 56ea2c2fe6108d39833ac40957afab59ade01a216639d5bafdeeca53bbf4cd67
* Remove an ALWAYS() that might now be false due to the prior check-in.drh2023-04-05
| | | FossilOrigin-Name: fc68993501aaa7180f5457dcb3c296e5b199904a385d98e2bcad7854e34d428e
* Fix the function that determines the collating function for an expressiondrh2023-04-05
| | | | | | | tree to handle new cases that arise as a result of the recently added ability to use indexed expressions in aggregate queries. [forum/forumpost/0713a16a44|Forum post 0713a16a44]. FossilOrigin-Name: cc5041f3f067cf610adffb868b4e2d1b5d248dc5a0ecc551339b670800ecb0ff
* Remove an assert() statement that is no longer valid due to enhancementsdrh2023-04-04
| | | | | | to query planner for improved use of indexes. [forum:/forumpost/dc16ec63d3 |Forum post dc16ec63d3]. FossilOrigin-Name: 2b23dd249d0bc254308f5539936d33ee558f1100dec616caac7317dbe70db761
* When translating arguments of aggregate functions into references todrh2023-04-03
| | | | | | | expression indexes, make sure to only translate them for the current aggregate when there are nested aggregates. [forum/forumpost/409ebc7368|Forum post 409ebc7368]. FossilOrigin-Name: 898bfa1afd8260eaaf2aa6db94e74d99ebf4e8a6dc02cf21d20cd981393609a5
* Earlier error detection for index expression usage by aggregate functions.drh2023-03-30
| | | | | dbsqlfuzz 29214ace4e25c98d2ddff8fbcf97afdda23f28b9 FossilOrigin-Name: 8e841e7f025f7205959453875f2d9db36271642045593970a2b2fc20b2f847c3
* Fix a crash that could follow an OOM error while processing aggregate functions.dan2023-03-30
| | | FossilOrigin-Name: 804435a2731bd3c26278c47098854b9ee7727a686587f6208e793738fbfc0555
* New #ifdefs to omit code that is unused except under STAT4.drh2023-03-29
| | | FossilOrigin-Name: 09a9b30ba7828a487a33a3ebf8028dfaa147dff67d2724584123b90a88d9814b
* Fix a weird corner case in aggregate function processing that results from thedrh2023-03-28
| | | | | | recent addition of support for index expressions on aggregate queries. [forum:/forumpost/bad532820c|Forum post bad532820c]. FossilOrigin-Name: c34fd9fe1b76e0a5943f014f46141cbe55d41bb1e6980adf9bcb6785a03e7883
* Improvements to register allocation, especially in the ANALYZE command.drh2023-03-26
| | | | | | New assert() statements added to help verify that memory allocation is correct, and to help fuzzer find lingering errors. FossilOrigin-Name: 6f8b97f31a4c8552312b4c98432ea356ae54c06d9cc929969f50c3c88360cd7b
* Add usage detection to the NULL value generator for the left table of adrh2023-03-25
| | | | | RIGHT JOIN inside of an aggregate. FossilOrigin-Name: 4d05a009dfb63bcb4173da4d09ccc00c308ce4dd2534a32aeb23c5d8d6a1fd4b
* When the left table of a RIGHT JOIN is used inside an aggregate functiondrh2023-03-25
| | | | | | | | and the left table employs an index on expressions, then make sure the expressions evaluate to NULL for the cases where the left table should be NULL. Proposed fix for [forum:/forumpost/9b491e1deb|forum post 9b491e1deb]. More testing an analysis needed - there is a FIXME in this check-in. FossilOrigin-Name: 3572b40a7dfc4acc35e72e08e79f64688f8737e57ac89e4d10e6b32bd5178c63
* In the byte-code, when the result of an expression needs to be in a particulardrh2023-03-25
| | | | | | | | register, always use the sqlite3ExprCode() routine because it has the smarts to know whether to use OP_Copy or OP_SCopy. Do not try to OP_SCopy inline because an OP_Copy might be required. Fix for the problem identified by [forum:/forumpost/5522082cfc|forum post 5522082cfc]. FossilOrigin-Name: c104e5c6eeb89575319d9f94f49446142b06912fa8b283c19d46aa2ccddc5bda
* A better fix for the sqlite3_error_offset() problem on generated columns.drh2023-03-20
| | | FossilOrigin-Name: 770b3e67c89ca16b08a9234acb626917a26ea414b3bc0340f9601644cb7504f2
* Expression errors in generated columns should not generate non-negativedrh2023-03-20
| | | | | | sqlite3_error_offset() returns. Second of two defenses against [33aa4c0de8a62e33]. FossilOrigin-Name: 2adb4e0dda471ffc9b2a5cbad01b6c2bc6091b7526a8c8b19944cb2d4a5111e7
* Fix Bloom filters on an expression index. drh2023-03-14
| | | | | | [forum:/forumpost/2e427099d5|forum post 2e427099d5] and [forum:/forumpost/d47a0e8e3a|forum post d47a0e8e3a]. FossilOrigin-Name: c028fb669a5ae34dbaf50fffab1ae49bc568b994435cf02e145d24da3cfb48d7
* Fix a typo in a comment. No code changes.drh2023-03-10
| | | FossilOrigin-Name: 76acc075402aac2d14d8279b8095008a842522a0985fdf89200da4339757a40b
* Do not use an expression index on a generated column if generated columndrh2023-03-03
| | | | | has the wrong affinity. dbsqlfuzz 65f5eb57f8859344d5f1f33e08c77ee12960ed83 FossilOrigin-Name: e95439119ac200cb47d0e277622f41ee7986b364487cd252b485ce5fa030d70f