aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* Make sure the affinity of the RHS of an IN operator does not affect thedrh2019-06-11
| | | | | | outcome even if the RHS expression contains a COLLATE clause. Ticket [57353f8243c637c0] FossilOrigin-Name: 0f748fe58bbbb7ce3f30303da25ec811b2bbce249549aa9c7927979ac5b38013
* Add the new sqlite3ExprUnmapAndDelete() function and use it in place ofdrh2019-06-11
| | | | | separate calls to sqlite3RenameExprUnmap() and sqlite3ExprDelete(). FossilOrigin-Name: 36ea13e0a851a749c9ef292377ecd82dbd4797d38df907b362487fa234c98ca5
* The ALTER TABLE command should not attempt to rename objects that are drh2019-06-11
| | | | | | | contained within an expression tree that has been optimized out because it is the other branch of an "AND false" expression. Ticket [533010b8cacebe82] FossilOrigin-Name: 04bd5cb73287f926f1ecf578998fa6ce1379474e86918c692eae5778d0817cef
* Update the sqlite3ExprCompare() routine so that it does not think "? IS NOT ↵dan2019-05-20
| | | | | TRUE" is the same as "? IS TRUE". Fix for [d3e7f2ba5b3]. FossilOrigin-Name: 99eba69b3a64741c69d167bf7a05dbe138c9e7faecc54a1b8d8220cb23902830
* Fix an assert() failure that could occur in a join query if the RHS of an ↵dan2019-05-18
| | | | | IN() operator is a list containing correlated expressions. This problem was introduced by checkin [e130319317e7611938] which was part of the fix for ticket [787fa716be3a7f650c] - so this commit is part of that ticket's fix too. FossilOrigin-Name: 778b1224a318d0137c7dab8361128f593506d3677267898119b934b4d66dfe38
* A new implementation for the sqlite3ExprImpliesExpr() theorem prover thatdrh2019-05-11
| | | | | | does a better job of answering TRUE to "(NOT A) OR B" when B is a NOT NULL expression. FossilOrigin-Name: b3413197f57711f04102d8cc6ff1e8ddbe0f5f2bcb6e1989cf314fa97f0ff7f1
* When considering partial indexes, do not assume that a "CASE x ..." ↵dan2019-05-11
| | | | | expression implies "x IS NOT NULL". FossilOrigin-Name: 1b24303220b7b4f59520176a0150fc619c668865450b4fdaa9ce4113a56e9687
* Do not assume that "x IS NOT ?" implies "x NOT NULL" when considering ↵dan2019-05-11
| | | | | partial indexes. Fix for ticket [8025674847]. FossilOrigin-Name: 0ba6d709b50d92db1542f2ff30535a80184b00dadf759d51e5cae7a6e37b1764
* Fix the NOT NULL logic in the theorem prover that determines when a partialdrh2019-05-04
| | | | | index can be used. Ticket [5c6955204c392ae763a95]. FossilOrigin-Name: c2e439bccc40825e211bfa9a88e6a251ff066ca7453d4e7cb5eab56ce7332635
* Mark a single branch as no longer reachable.drh2019-04-19
| | | FossilOrigin-Name: 4f35b3b78a461b0617a5cd04f60d2ab277bcc7c994dae463851a3cb5d041a723
* Improved optimization of the AND and OR operators.drh2019-04-19
| | | FossilOrigin-Name: 0fbd154eb419b57b9c064c1f47346835d6324388b966b73f8a0122de065f08b1
* Use macros to determine if an expression is always true or always false.drh2019-04-19
| | | FossilOrigin-Name: 6de980a09c3a7adf71f2c9a63a242673b5e1f246e8ee071b26844275f0dad0fc
* Streamline the processing of the AND operator. Slightly smaller and faster.drh2019-04-19
| | | FossilOrigin-Name: 7713996aa99ce6dd35b5a2db74dd26658fb8d9817169b2a7531cdef6edb41403
* Fix an obsolete comment and other minor issues from code inspection.drh2019-04-14
| | | FossilOrigin-Name: cd084427319394386844d6651479256a2fd57a412fccb79ba53172ce76693eb1
* Enforce the SQLITE_LIMIT_COLUMN limit on virtual tables.drh2019-04-13
| | | FossilOrigin-Name: 0b6ae032c28e7fe34d81d1769f6e2901addbd1b95cd9a255dcef274061fb0164
* Eliminate the tool/addopcodes.tcl script. The purpose of that script was todrh2019-04-05
| | | | | | | keep the number of parser codes below 256 in order to save parser table space. But we have long since blown through that ceiling so the addopcodes.tcl script was just needless complexity. There is no longer any reason to keep it around. FossilOrigin-Name: d272819298083ebbde57962a2938925b1aaa1caf03e48bb3ea26ad91e0461d84
* Improvements to the sqlite3ExprImpliesNonNullRow() theorem prover.drh2019-04-01
| | | FossilOrigin-Name: 3fde627616030ca0de87169467e2e453fdc91154942e3a3a92a221df5923b2d2
* Make all ephemeral tables built to hold the RHS of an IN operator bedrh2019-02-22
| | | | | | | index-btrees, never table-btrees, regardless of whether or not they are used as IN_INDEX_LOOP or IN_INDEX_MEMBERSHIP. That way, the same ephmerial table can be reused for both cases. FossilOrigin-Name: c2d50df8fd1a1fdae6226a3e77296ded09b53a74540caedd4868e686a93cbc10
* The IS NOT NULL operator does not imply that the operand is never NULL.drh2019-02-05
| | | | | Fix for ticket [5948e09b8c415bc45da5cf] FossilOrigin-Name: d840e9bb023a1e84a7739d764a0f6cf608fc3183ff8c366fcdb486ebd932f0c1
* Ensure that the Walker.pParse structure is initialized when walking thedrh2019-02-01
| | | | | source tree to gather the WINDOW clauses on a query with window functions. FossilOrigin-Name: 4ca9d5d53d41d08fbce29f9da8cc0948df9c4c3136210af88b499cf889b5ccb8
* Fix problems with sub-selects in WINDOW definitions. Also rename-column ↵dan2019-01-23
| | | | | operations when the column being renamed appears in a WINDOW definition that is part of a VIEW or TRIGGER. FossilOrigin-Name: 0387cb3add992b2028efe4f2100188d8f9fdfdcb233329857aa4b46a293cfc97
* Fix a problem with using ALTER TABLE to rename a table or column when thedan2019-01-19
| | | | | | database schema contains a trigger or view that itself contains an expression "<column> AND 0". FossilOrigin-Name: 908ff7fffa302255a74e2334ca3a1779ed43acb0268fce5a83a56fd16794dc88
* Fix a failure in sqlite3ExprCompare()drh2019-01-17
| | | FossilOrigin-Name: 835e2cc55feea2f2426c99816c27f9c35d2fd4cdd9bf1c7f46f889ecfd222778
* Fix a problem with ALTER TABLE and vector assignments in UPDATE statementsdan2019-01-15
| | | | | within triggers. FossilOrigin-Name: cc6cd7531fee39b4c2a9f522f1089c1d79254a9e25acae59468322031f94c25a
* The keywords TRUE and FALSE should only act as boolean literal values ifdrh2019-01-11
| | | | | unquoted. FossilOrigin-Name: 5547f39de993c708f72301ef25df190a2f007e0c4253799bdd9e86bb1ae41777
* Add the exprNodeCopy() routine that will safely memcpy() an Expr node thatdrh2019-01-05
| | | | | might be a size-reduced node. FossilOrigin-Name: a874c649960ba2e2b2fd380d08c02a45884a1060d3922be8847729008ca6766e
* Fix harmless compiler warnings.drh2018-12-31
| | | FossilOrigin-Name: b57c545a384ab5d62becf3164945b32b1e108b2fb4c8dbd939a1706c2079e18b
* Merge enhancements and bug fixes from trunk.drh2018-12-31
|\ | | | | FossilOrigin-Name: 9fb646f29c05bca5f677a2c7c4f45c36bfe0a0c6a88cb7968b4a0459bdd63bb2
| * A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewerdrh2018-12-29
| | | | | | | | | | | | | | | | | | memory allocations by deferring memory allocation until sqlite3VdbeResolveLabel() is called, at which point the code generator has a better idea of how big the relocation table needs to be. The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of Vdbe*. FossilOrigin-Name: 4a0929ac76d8aa5dd65eac3b83d6bbf41e505e01d175ca0fb2b19ba02d439415
* | Improvements to EXPLAIN QUERY PLAN formatting. The MULTI-INDEX OR now showsdrh2018-12-24
| | | | | | | | | | | | a separate "INDEX" subtree for each index. SCALAR SUBQUERY entries provide a subquery number that is related back to the .selecttrace output. FossilOrigin-Name: 7153552bac51295c56a1c42ca79d57195851e232509f9e9610375692f48c7e86
* | Do not generate subroutines for non-static SELECT and EXISTS expressions.drh2018-12-24
| | | | | | | | | | | | Fix up some test cases to account for the minor changes in EXPLAIN QUERY PLAN output. FossilOrigin-Name: 06de44ec9e173992ca9afb89dd2b4e40d2a7e35512c7959603cdceb606f5dfbd
* | Prevent the use of subroutines to implement the RHS of IN operators withindrh2018-12-24
| | | | | | | | | | CHECK constraints. FossilOrigin-Name: 6b24d3fb94e787d25e49501714780dfb0c0c99077102056aa68445f4808cdd57
* | Experimental code that tries to put the computation of subqueries inside adrh2018-12-24
|/ | | | | | subroutine, and reuse that subroutine if the same subquery is evaluated more than once. Current code does not work for CHECK constraints. FossilOrigin-Name: 6c44838adbe5dc482bc010e91a6dd7a0f777c989f443dd600740d2c783208e0d
* Split the code generation for the RHS of IN operators and for SELECT anddrh2018-12-23
| | | | | | | EXISTS expressions into two separate subroutines, because there is now little commonality between those to functions. This is intended to help make the code easier to read and maintain. FossilOrigin-Name: 2b6494b1509f0d0189f98aa34c990eee99c775ff57826e79b2c5b0a12b4c97ad
* Do not all REPLACE to sneak a NULL value into a NOT NULL column. Detect thatdrh2018-12-22
| | | | | situation and ABORT instead. Fix for ticket [e6f1f2e34dceeb1ed61531c7e98]. FossilOrigin-Name: db8d1d12f5c1673404b2afb5426d5ea3afe3b69d01f8f2bc47ffdf70684fdf24
* Fix a segfault caused by using the RAISE function incorrectly (library nowdan2018-12-20
| | | | | returns an error instead of crashing). FossilOrigin-Name: ddf06db702761d663119d508afe21d7dfebe963d576bb42fc2f2024205ab86f8
* Fix another problem found by Matthew Denton's new fuzzer.drh2018-12-12
| | | FossilOrigin-Name: 2b690dbdffe144bd69ca0aa291c230faf3d9d73f7a2985d50f016fe54003f9a9
* Remove an ALWAYS() from a branch that is not always taken. The test casedrh2018-12-12
| | | | | found by OSSFuzz has been added to TH3. FossilOrigin-Name: 5c7dab85535ac42c021977dbd4a39cef5a72e3d9dccff1c5ca5570a1780516cd
* OSSFuzz found a case where an assert() inside sqlite3ExprCompare() can bedrh2018-12-12
| | | | | true. Test case added to TH3. FossilOrigin-Name: 23b62fb160d86dc9d9073bcc714601f5b7695f96abd893eafecf4b2e565b87f2
* Do not use a partial index as a table scan in an IN operator.drh2018-12-08
| | | | | Fix for ticket [1d958d90596593a77420e59]. FossilOrigin-Name: 15bc915dd7ae25bfdfbe357c3792db3639799e4d121c6b5b24297af2d6d7129e
* Performance improvement: Avoid using sqlite3WalkerSelectExpr()drh2018-12-06
| | | | | | and sqlite3WalkerSelectFrom() twice, so that the compiler will in-line their implementation. FossilOrigin-Name: 2b9258b8b0342330ebe8c22b59ec276fd042a05547d15b24fdf29e16280868de
* Fix the sqlite3ExprDup() routine so that it makes complete duplications ofdrh2018-12-06
| | | | | subqueries containing window functions. FossilOrigin-Name: 940174543e87184a0278fcd02e8a096a11510174d9c1d65d21878819790ddaff
* The sqlite3_normalized_sql() interface should not be transforming quoteddrh2018-12-05
| | | | | | identifier names into wildcards. Fix this, and at the same time simplify the code substantially. FossilOrigin-Name: e8540377ec66fa5f9ae3c93bedb5c094057698199c37fc211f7ea95429e815e4
* Deploy the sqlite3Strlen30NN() function (argument guaranteed to be non-NULL) fordrh2018-10-31
| | | | | a small performance improvement. FossilOrigin-Name: 4a6ad5190b62020d97a7de02c801544f20b7b98145ceff14af1f2834d3057f9c
* Add the sqlite3_normalized_sql() API.mistachkin2018-10-29
| | | FossilOrigin-Name: 592b66e8058dd03a056a036e2606247c9efdb06d15eebe9bcc455f7f55e30ae6
* Slightly smaller and faster alternative to [507d892c3a40a0bacbd47] thatdrh2018-09-24
| | | | | | fixes a problem with views that use window function as part of complex expressions. FossilOrigin-Name: d7c816ae15f05f21b9b213161e1044aaefc56f17e7bc4b7b551a9e04efc05855
* Fix a problem with views that use window functions as part of complex ↵dan2018-09-24
| | | | | expressions. FossilOrigin-Name: 507d892c3a40a0bacbd47ed3c4fe2d8925a82716ae08da8401750a42782ba454
* Fix a faulty assert() in the validation logic for the LEFT JOIN strengthdrh2018-09-23
| | | | | reduction optimization. Problem found by OSSFuzz. FossilOrigin-Name: 2fd62fccd13e326dbd7dd730112542c6faa56e466bf4f7b8e22ced543031280c
* Combine the Expr.pTab and Expr.pWin fields into a union named "y". Add a newdrh2018-09-20
| | | | | | | EP_WinFunc property that is only true if Expr.y.pWin is a valid pointer. This reduces the size of the Expr object by 8 bytes, reduces the overall amount of code, and shaves over 1 million cycles off of the speed test. FossilOrigin-Name: ad130bb86e74e6ce165fdbdce3a19699510f0e62071c1c7923b5a4538d888c7c
* Merge fixes and enhancements from trunk.drh2018-09-01
|\ | | | | FossilOrigin-Name: 589186c083ff3af8d5a6d5ad34e1cefea57806ebf3831ea3bf5a48ef1e173140