aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
* Fix harmless compiler warnings.drh12 days
| | | FossilOrigin-Name: 13af4acebe09b047756c22b800136cffaba532e7fcaa448a4edf4fedb94e9bbc
* Make the value of an explicit LIMIT clause on a scalar sub-query available ↵dan13 days
| | | | | to xBestIndex for simple "LIMIT 0" and "LIMIT 1" queries. FossilOrigin-Name: 33b6a63caafccc61b3193714911cd8b5dd9b7f1798054b8c7845b23688d531f2
* Improved byte-code comments for the short-circuit optimization ofdrh2025-07-01
| | | | | [0083d5169a46104a], to aid in debugging. FossilOrigin-Name: 113f9d10e347eeaa893ff8b47a461009e0b12589374b93cf3e0bddd19c702dea
* When attempting to optimize "expr AND false" to "false" anddrh2025-07-01
| | | | | | | "expr IN ()" to "false", take care not to delete aggregate functions in the "expr" as doing so can change the meaning of the query. See [forum:/forumpost/f4878de3e7dd4764|forum thread f4878de3e7]. FossilOrigin-Name: 77397bd67d918db57d5ac545d6d963194806fdabcdaa8f822b6b09e4cfe8b715
* For all binary operators, try to avoid computing subquery operands if thedrh2025-06-30
| | | | | other operand is NULL. FossilOrigin-Name: d86eb16283c4b573c506d4faa422d5d9aeb6abc279d8e6a8e2104737162d417f
* Slightly smaller and faster version of the previous check-in.drh2025-06-30
| | | FossilOrigin-Name: f6e6fd02f4ad49c390a2d3c9626d57f9b2fff1f67eb361b30074cc1f5121810e
* Factor out the code that tries to avoid evaluating subquery operands if thedrh2025-06-30
| | | | | | other operand is NULL into a subroutine, so that it can be more easily reused by other parts of the code generator. FossilOrigin-Name: 3c6c71bcea16443b82234414137dfa1b59e2ee8fe5097906c738fc1228fec4e6
* Improve the bytecode generated for comparisons so that if one operand isdrh2025-06-28
| | | | | | | a subquery and the other operand evaluates to NULL, the subquery operand is not even computed. This fixes 5 of the 12 slow queries described in [forum:/forumpost/52651713ac|forum post 52651713ac]. FossilOrigin-Name: f147bc04776ac0056412f69dfc518016c0d5b4e9d964664e3d88f595fb29dbe0
* Raise an error right away if the number of aggregate terms in a querydrh2025-06-27
| | | | | exceeds the maximum number of columns. FossilOrigin-Name: 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8
* Extend the pedantic enforcement of type to VIRTUAL columns.drh2025-06-18
| | | FossilOrigin-Name: b734c74e55acb26eb61b60937bef870f4b55b2e2e7560a22362f5f31ba2fcd03
* Improve the accuracy of affinity and collating sequence analysis fordrh2025-06-02
| | | | | | | NATURAL JOINs to the left of RIGHT JOINs where source tables are views or subqueries. Initial problem report in [forum:/forumpost/829306db47|forum post 829306db47]. FossilOrigin-Name: f184d1d236e47962658a4639d9533f67a525b74cfe0f06c93e9b85fdcd02a15f
* Fix a bug in the NOT NULL/IS NULL optimization of check-in [cb94350185f555c3]drh2025-05-06
| | | | | | | | | that can cause invalid data to be used for a column if that column has a CHECK constraint that includes the NOT NULL or IS NULL operator. Problem discovered by the [https://issues.chromium.org/issues/415397143|Chromium fuzzer]. Never seen in the wild, as far as anybody knows. FossilOrigin-Name: 2adaee9aa90f280a406007695fbc4a314806584c93d6b62b46c031492b31ec27
* Fix an issue in Bloom filters on RHS subsqueries to IN operators.drh2025-04-30
| | | | | | | See [forum:/forumpost/792a09cb3df9e69f|forum post 792a09cb3d] for a description of the problem. Also improve comments related to [baa83b460c677c21] which was origin of the problem. FossilOrigin-Name: cdef486e212fe4b26605065d9cff08f608cb80df48ee64e4be63637769bdfacc
* Make use of the flexible-array feature of C99, when available, to try todrh2025-03-14
| | | | | | pacify -fsanitize=strict-bounds. This check-in fixes the core. There is more yet to do in FTS3, RTREE, and in FTS5. FossilOrigin-Name: 6fd6b32d06bd6a705e5140cd613af823b8183a6f6a9ceeeedfcf5e8b50821d68
* Approximately 100 typo corrections spanning the whole tree, submitted via ↵stephan2025-02-27
| | | | | [forum:0db9827f0464bc33|forum post 0db9827f0464bc33] and individually audited and verified. Affects only code comments, innocuous test strings, error message text in tool (not library) code, and configure-level help text. FossilOrigin-Name: f50c21484d3cac73589da0376c423de39ae8b842218105786c5aa3726e4dcaed
* Detect when a UNIQUE or PRIMARY KEY on a WITHOUT ROWID table would needdrh2025-02-21
| | | | | | to use more than SQLITE_LIMIT_COLUMN columns and raise an error. Also include some unrelated compiler warning fixes. FossilOrigin-Name: d7729dbbf231d57cbcaaa5004d0a9c4957f112dd6520052995b232aa521c0ca3
* Code changes that make it easier to prove that no 32-bit integer overflowsdrh2025-02-17
| | | | | | happen during memory allocation. No problems fixed; this change is just to make future maintenance easier. FossilOrigin-Name: 215650a5a1d55bdbca9c92524804a1a54456a17f42a17e53747b21a6507506f5
* Remove a pointless line of code.drh2025-02-10
| | | FossilOrigin-Name: 57b2b812c8c5524f315e20cee0e6a12a3b1635aeb42925bf891532a7029d0eb0
* Use the sqlite3ColumnIndex() routine to look up a column in a table, ratherdrh2025-02-08
| | | | | | than using a custom loop. Performance improvement, size reduction, and complexity decrease. FossilOrigin-Name: 351dbbc2bf0b23efdc625ddaa5dc2239cf2990addf071a04bd41612b341de8c8
* The reuse-subroutine optimization [c9a3498113074bbc] might have generateddrh2025-01-30
| | | | | byte-code that loops forever. This check-in fixes the problem. FossilOrigin-Name: 0cc4ed8c6e53aca1f5e94c132bedbc7f561c04a77f1a30b965ffe7560634bfeb
* Simplifh the IdList object to remove unnecessary fields. Performancedrh2025-01-28
| | | | | increases by about 0.8%. FossilOrigin-Name: a4625bb995dd5582d1f3cf0c2e54eb3f01f1cc1405811dda86ebd38b2b858994
* Better job at suppressing harmless scan-build warnings. This time testingdrh2025-01-11
| | | | | and working. FossilOrigin-Name: c847973947de67579fab78a65ecfc90bf59fd5db0b7fa7a9c1abb1fc92213d01
* Fix harmless scan-build warnings.drh2025-01-11
| | | FossilOrigin-Name: b93af6feb7c0c3af30a47810a7c0e77ce41c386fac164c64bb5871a6c153db7e
* Increase the maximum number of arguments on an SQL function to 1000 with thedrh2024-12-12
| | | | | capability to increase it further up to 32767 using a compile-time option. FossilOrigin-Name: e8d7d68ba0bb0bc2f948db5d9966990a5d23597fc3658b7cd0bc99d53c7353a9
* Fix a comment typo on the sqlite3ExprIsSingleTableConstraint() routine.drh2024-12-02
| | | FossilOrigin-Name: 346a845bf1cd1c7e542f7bf763d86c197d9a3b4f3ea38ade416790a1cf80e6f2
* A NEVER() that was added by [eb5ac9e5b9a4f9c8] is violated by the ifnull()drh2024-11-30
| | | | | in-line function. This check-in fixes that problem. FossilOrigin-Name: 2220ccf4d6fea2413015c72fd318003b4b5afeae7cb7586b714fce36212d8c49
* Fix a NEVER() in the iif() logic that can be true if compiled withdrh2024-11-29
| | | | | SQLITE_ENABLE_UNKNOWN_SQL_FUNCTIONS. Problem introduced by [eb5ac9e5b9a4f9c8]. FossilOrigin-Name: 3ec2df5a6c731b59b0ab132ee59c74d107f9c4bd32cf47d9776887858b9c0dea
* Simplification to the fix in the prior check-in.drh2024-11-28
| | | FossilOrigin-Name: f79cb748c9447ca4d2184a24219feb19571eb79870e0bedf14704743a3d5f8b9
* The sqlite3ExprCompare() routine should always compare the same variablesdrh2024-11-28
| | | | | as equal to one another, regardless of whether or not QPSG is set. FossilOrigin-Name: df95d5209a77c0302e08ea7b1f248646fb2a062ba5beca898678aee0a1d03a3a
* Add two NEVER() conditions.drh2024-11-28
| | | FossilOrigin-Name: 4f358ad20dc8a45e7aaa1a1996b40abd39caf34be6556ed54e1e0c80572b7ac0
* Enhancements to sqlite3ExprImpliesExpr() so that it realizes thatdrh2024-11-28
| | | | | "iif(A,B)" implies "A". FossilOrigin-Name: d96ecbee59b50eca25447456dfff2c168e8eade7a68e542932d5829f97debb31
* Add an ALWAYS() on a branch in the new indexed-subtype logic.drh2024-10-08
| | | FossilOrigin-Name: f150c3c5b898975b1f83d61fa589753449a48f8a0007e8e167dbd702528197c5
* Add a NEVER() to an unreachable branch in the new indexed-subtype logic.drh2024-10-07
| | | | | Mark the pi() function as deterministic. FossilOrigin-Name: 50be8f5091b2202b67a80f826feee2c378f001745ad5acb7c4374423bbf6ff22
* Allow expressions with subtypes to be read from indexes unless they are ↵dan2024-10-05
| | | | | being used as direct or indirect parameters to SQLITE_SUBTYPE functions. FossilOrigin-Name: aa440e78e9004c7ca3e03beaf264f54d0070ad7298a3c96ca097d8b35c872e5f
* Experimental change to allow expressions with subtypes to be read from ↵dan2024-10-05
| | | | | indexes in situations where they are not used as function parameters. FossilOrigin-Name: ac63f98ad85a4dd1e49cc64b41f0ca0044153972c15d71c669f4bc3ec590e268
* 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
* Reduce the size of the SrcItem object by combining fields into a union.drh2024-08-17
| | | FossilOrigin-Name: a4c59ac3c6ec979c25b544d29e47b8e39f6439c098eed8f84b3bd506c9adf047
* Fix an oversized allocation in sqlite3ExprCodeIN().dan2024-07-20
| | | FossilOrigin-Name: d7be326a80e7b3aa8fd6e5e059c04e6ad3feaffcb20b1e3c251d7195ddc1be8b
* Fix a use-after-free that could occur following an OOM introduced by [d8cedbe0].dan2024-07-08
| | | FossilOrigin-Name: 4fabfacfcf38e129949d3e4e2c3ffde3da3cd40d9d12c97ca29bc7c3604db6ed
* Use a mini Bloom filter to help reduce the number of pointless searches fordrh2024-07-05
| | | | | | prior SubrtnSig objects when generating code for IN operators with subqueries as their right operand. FossilOrigin-Name: d8cedbe055b40a0ea4e5d47845b535162e9fcb0d0f88c03211797ab64d2d56fb
* Small performance optimizations.drh2024-07-05
| | | FossilOrigin-Name: 99fd34b58a9b09af20f1f1a3c37137ae55159310c8af97806550eeee6adc4fc5
* Disable the reuse of IN-clause subqueries if the subquery is an explicitdrh2024-07-04
| | | | | | | | "SELECT ALL". The ALL keyword is almost never used in actual practice (most developers don't even know it can be used) so this should not interfere with the optimization, but it does give us a convenient way to turn it off for testing purposes. FossilOrigin-Name: a81299be2ce203dcc28e7d0ba24791cbfba80e1ee3e1564469a226cac8adb17d
* Be more aggressive about reusing subqueries that appear on the RHS of INdrh2024-07-04
| | | | | operators that have been replicated due to the predicate push-down optimization. FossilOrigin-Name: 2accf32b6e45a396503c29eecc14a103bcc7b4c313cde921b26b489704060177
* Use a Bloom filter to improve performance of IN operators when the RHS ofdrh2024-07-03
| | | | | the IN operator is a subquery. FossilOrigin-Name: 1933496539c19cbf429a39d6b0b1c6b1b2af50733a3c4aea4920990ced652f6a
* Add a NEVER() around a branch in sqlite3ExprAffinity() that is designed todrh2024-06-29
| | | | | | prevent an infinite loop, but which can now never be reached due to recent changes. FossilOrigin-Name: da0b794852f8ccba5bd30395892044ec71b148075608406867785395e1f50b31
* Additional steps to make sure calls to sqlite3ExprToRegister() are sane.drh2024-06-28
| | | FossilOrigin-Name: 1c42d7176b228791f99bc9971d92a9ab67b1e2956ca4f8d934bd1a3e596d6c80
* Better optimize queries that use parameters in the LIMIT clause.drh2024-06-06
| | | FossilOrigin-Name: e58cb304d1e0ec6e30260a165aaccc2cf096ce6c999efb06683c4ef600ee12ef
* Ensure that queries like "SELECT indeterministic(a) FROM tbl GROUP BY 1" ↵dan2024-05-24
| | | | | invoke the indeterministic function only once for each row of tbl. FossilOrigin-Name: 4555d66547e28cb110e1012b145bcf3aafb5d4bde05e9d27bcb4ca33837b28f5
* Merge branches "fix-onerow-opt", "faster-openread", "fts5-delay-tokenizer" ↵dan2024-05-17
|\ | | | | | | | | and "enhanced-raise", each containing minor enhancements prepared for 3.47, into this branch. FossilOrigin-Name: 6dc6472175bccbed15ebf6811c209d1a0b5fad60158fb32040210f2cdae916a6