aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
* Fix a bug in the NOT NULL/IS NULL optimization of check-in [cb94350185f555c3]drh13 days
| | | | | | | | | 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
* | The sqlite3FaultSim(300) error from [1e8863909ac369e5] must be treated asdrh2024-05-10
| | | | | | | | | | | | an OOM, since it simulates an OOM. Also fix deferred deletion of Expr objects from [a53bdd311c4154fd] so that it does not corrupt the AST if an OOM occurs. FossilOrigin-Name: c623d9a51e0ae6b4a8e1186714d14e7aa3df55246e123323481f07f07749dea5
| * Allow arbitrary expressions as the second argument to RAISE().drh2024-05-08
|/ | | FossilOrigin-Name: 003e1c8c27824cb917b3869bdf9000f32ff0b6887a2aff8516712cfe865cf34d
* Avoid unnecessary recursion in sqlite3ExprDeleteNN(). This complicates thedrh2024-05-06
| | | | | | code, but it is needed to prevent nuisance "stack overflow" reports from OSSFuzz while it is running the latest ASAN. FossilOrigin-Name: 70abc144ca90a58ea25dc2d90683545246c084d961215c20ec070b0abe640371
* Avoid slowdown when exprNodeIsConstant() is called on deeply nested SQL ↵dan2024-04-24
| | | | | functions. FossilOrigin-Name: 1c0b0345451853846076467831884f951c92ec79476be40ce7f7b766fd2d8fc1
* Merge trunk enhancements into the pushdown-subquery branch.drh2024-04-07
|\ | | | | FossilOrigin-Name: 27865e316f8dfbf4c20290cf1be3024d7518fec46655e34f3fc435e15346c63e
| * Add comments to note the name abiguity between the MySQL push-downdrh2024-04-07
| | | | | | | | | | optimization and the WHERE-clause push-down optimization. FossilOrigin-Name: 3d5fb1ec7a0440072d6e3b957903c85d0f32b8b07207a1ef22d1a69cf5e664d1
* | Do not allow changes to sqlite3ExprIsTableConstant() that support pushdown ofdrh2024-04-06
| | | | | | | | | | subqueries interfere with the hash-join logic. FossilOrigin-Name: 8682931f9c6b40e1b09139c10bbe932c38330b5eb0c5c84f2432ad19a6793e37
* | Generalize pushdown to allow any uncorrelated subquery to be pushed down.drh2024-04-06
| | | | | | FossilOrigin-Name: 87c45fb0d5f5ca5d6d1ad27bef83f294231d17d94299e1997364a7975b423e38
* | Experimental enhancement in which expressions of the form "expr IN table"drh2024-04-05
|/ | | | | can be pushed down into subexpressions. FossilOrigin-Name: 2cbd7838fd6ffdf210f34671cd2e3e749a076a3a6f155bbe5f910a67db31c5b1
* The RAISE() operator is not a constant expression and cannot participate indrh2024-03-25
| | | | | | the VALUE-as-coroutine optimization. dbsqlfuzz 74cf7c9904360322a6c917e4934b127543d1cd51 FossilOrigin-Name: 6a06dc73847716c88d65651d1bf0e002002303881df1389beac884d0032eae08
* Do not automatically assume that ROWID is NOT NULL when compiled withdrh2024-03-24
| | | | | | SQLITE_ALLOW_ROWID_IN_VIEW. dbsqlfuzz 31b38eeb63a4e1562de665078f52b7b47a7543cf FossilOrigin-Name: 80c4223098c1827ff3a564f1f9a4203164a943e9a83eef99df68378fa3c4764b