aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
Commit message (Collapse)AuthorAge
...
* 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
* | The interior of the RIGHT JOIN loop is now a subroutine.drh2022-04-09
| | | | | | FossilOrigin-Name: 549f5a7ee639de80f049445002f58e93c805f9a3d3db1987ec9d139ccef4805e
* | A few bits and bobs of code generation toward getting RIGHT JOIN to work.drh2022-04-09
| | | | | | | | | | Much more remains to do. FossilOrigin-Name: 55b4543122646997d928598343bc467c993f971e86e9037c85430cc948750576
* | 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
* Enhance the EXPLAIN output formatting in the CLI so that the subroutine thatdrh2022-04-07
| | | | | implements the loop body for the multi-index OR optimization is indented. FossilOrigin-Name: c2965fea9df7076b235d3eadaf84f0a36242476d0329030b0e57557b66e2540c
* Fix the code generated for vector IN operator constraints on virtual tablesdrh2022-03-07
| | | | | | | | | | so that they work even if the "omit" field in the sqlite3_index_info object is off. This has apparently never worked correctly before. Presumably, nobody has ever before written a virtual table that can use vector IN operator constraints and that relies on bytecode to double-check the constraints. Test cases in TH3. Problem discovered by dbsqlfuzz cab8e26194a40147627094f3c6849c0a7b1e0310. FossilOrigin-Name: 21b656572d066b640ff5774205a4f0db13e1b08a35d0fd484da9130e759b0c26
* Restore the ability to push-down OR subterms of the WHERE clause whendrh2022-03-03
| | | | | processing a multi-index OR. FossilOrigin-Name: d71fb6fdc32d2fce73059b6ab86d7d7bbc812c637469755dd45b6794aadc3a80
* Fix for the problem identified in drh2022-03-03
| | | | | | | | | | | | [forum:/forumpost/0cd8e058bf|forum post 0cd8e058bf]: When evaluating an multi-index OR, do not push down auxiliary WHERE clause terms that involve subqueries into the OR-subqueries. Otherwise, the covering-index optimizer might convert table-references into index-references for the particular OR index that is active for the branch in which the subquery subroutine is coded, and those index-references will not work if the subquery subroutine is invoked from a different OR branch that uses a different index. FossilOrigin-Name: 61a1c6dbd089979cbeb8b0c0c5ee1ab1abcb466be1d21a3a851be73c27e67a6c
* Bloom filter pull-down optimization is incompatible with Skip-Scan.drh2022-03-02
| | | | | | Make sure the query planner does not try to to both. [forum:/info/50a1bbe08ce4c29c|Forum post 50a1bbe08ce4c29c]. FossilOrigin-Name: ad3ffa1a75a5a032ebb64d8e014ee0a85c5e44b732e4b11bd67f31a59e729b94
* Improved comment on the codeDeferredSeek() routine. No code changes.drh2022-02-25
| | | FossilOrigin-Name: 54f49f65ac943263a1622b1efe519c8a61f30f23694fd4fec89ad2bf0e17b473
* Record the position of many identifiers in the parse using the newdrh2022-02-05
| | | | | | | Expr.w.iOfst field. This is done with the idea of providing offset results for sqlite3_error_offset() for a more kinds of errors, though that part is not yet implemented. FossilOrigin-Name: 32a3a53b62ab09ac2212905e7f42fe6f1b09d891e015203e5caf4cb16262f18e
* For the MULTI-INDEX-OR optimization, when pushing down WHERE clause terms fromdrh2022-02-04
| | | | | | | | the main query into the various OR-term subqueries, do not push down slices of a vector comparison, since the right-hand operand of the comparison might have only been initialized in a different OR branch that was not taken. dbsqlfuzz 80a9fade844b4fb43564efc972bcb2c68270f5d1. FossilOrigin-Name: 9f67ad00cd38b7c5ec6d14b379e1a611777bbdf6901d843a80712ba7d94d6d33
* Add new interfaces to enable virtual table to process IN operator constraintsdrh2022-02-01
| | | | | all at once, rather than one element at a time. FossilOrigin-Name: eb84b80e1f6d8c32bf0c9e1731f0233de0160a13f714f766779ae01fdf504e7b
* Query planner always honors the aConstraintUsage[].omit flag for thedrh2022-01-27
| | | | | SQLITE_INDEX_CONSTRAINT_OFFSET constraint. FossilOrigin-Name: 38c5151eb8cc789ad082a1b40d16b2ddb55454219bd685b6e420995af6a15f55
* Give the virtual table xBestIndex method access to (some) OFFSET and LIMITdrh2022-01-27
| | | | | clauses. FossilOrigin-Name: 74fa5757ee0a8499bcd6546dac1a3ecc6048ba9cff9e3e574e28e6e82e894a3d
* Remove many redundant checks for sqlite3.mallocFailed now that any OOM shoulddrh2022-01-24
| | | | | cause Parse.nErr to be non-zero. FossilOrigin-Name: 1f7fa46126ea33ed30e93186aff3df51068aeb4be6f79a102bfe8c4e44941d71
* When computing a vector to be used as a key for an index lookup, do notdrh2022-01-21
| | | | | | | | check for NULL values and abort until after all key values have been computed, in case one of the later key values involves some initialization that is needed by a LEFT JOIN. Fix for the problem identified by [forum:/forumpost/ab95010d410a0a55|Forum post ab95010d410a0a55]. FossilOrigin-Name: 4db5217a28ce767fa14ddfe51cf3ca25eceb72079d46a2fc00f7d6b8ae9abe0b
* Do not allow early evaluation of Bloom filters that use the IN operator asdrh2021-12-11
| | | | | | the machinery to deal with the IN operator is not available. dbsqlfuzz 5b51c247518278f79a45cea978702e86e86cd4f9. FossilOrigin-Name: 799db7cb2e0d73031182d26a0e5919368f9f9823df81cb2863bfe79eca344f5c
* Rename the internal routine constructBloomFilter() todrh2021-12-10
| | | | | | | | sqlite3ConstructBloomFilter(). OSSFuzz is reporting a crash with a garbled stack that we cannot reproduce. Perhaps the original "constructBloomFilter()" name is colliding with some internal name used by OSSFuzz. We'll see if this rename clears the problem. FossilOrigin-Name: 403e7312dd9a3fe493a21aceb82e387d6f152622d66c1b403c881597713e8cc3
* Remove unused code and fix comments. Final cleanup before merging.drh2021-12-09
| | | FossilOrigin-Name: ce42039f5647b1f276acf5d9911528ecb47df1544a587def72c8cd6b2f664289
* Enable bloom filters for the right table of a LEFT JOIN. Fix unreachabledrh2021-12-09
| | | | | branches. FossilOrigin-Name: d342ab722de1fc3f34219c9755253db9d88eb50a6fa5cc257207008b00e7fc03
* Add SQLITE_TESTCTRL_LOGEST and enhance the LogEst utility program.drh2021-12-09
| | | | | Improvements to testability of bloom filters. FossilOrigin-Name: 88b43d798cc5aa59855e92d3e658aee9f0a5def6ffbc5db77af048d75ecdf8cc
* Merge the WhereClause fix from trunkdrh2021-12-08
|\ | | | | FossilOrigin-Name: d3250256772e3348abe887c0ca3550a6647cce3804c9456a9d0112aea7ee1c46
| * In the WhereClause object, do not assume that all TERM_VIRTUAL terms appeardrh2021-12-08
| | | | | | | | | | | | | | | | at the end of the list, because that is no longer true. Instead, keep a separate nBase count that is the size of the list excluding the tail of virtual terms. Use nBase instead of nTerm when scanning terms that are not virtual. Add assert()s to validate correctness of WhereClause. FossilOrigin-Name: 6024682ca467fa4fe49608772b0bbfa2f8a419b32cebfa715941073c8b29da49
* | Improved EXPLAIN QUERY PLAN output for Bloom filters.drh2021-12-06
| | | | | | FossilOrigin-Name: 00070e1fff6aec3d7c7b121f2b02bbca38a1664aca9afc3fb7e293f07fd1704f
* | Run as many Bloom filters as possible before index lookups.drh2021-12-05
| | | | | | FossilOrigin-Name: 06f6fefd67086896bc49272c6319545ff6c6792f18babe23aced27b60b032119
* | Try to run all Bloom filters before any Seeks. This gives a small performancedrh2021-12-05
| | | | | | | | | | gain on the Star-Schema Benchmark. FossilOrigin-Name: 5be2470f8755ef454f813c880e659bdbf82f2396be9320cf3079cd4ca8e81a19
* | Add VdbeCoverage() macros. Adjust the Bloom-filter hash function so that itdrh2021-12-04
| | | | | | | | | | correctly deals with zero-blobs. FossilOrigin-Name: 629ee2e3e3125bfd2af435c6713d49e46691213ad15db0a5e93a63a77f1130c2
* | Apply the Bloom filter only on those terms of an index that have equalitydrh2021-12-04
| | | | | | | | | | constraints. FossilOrigin-Name: a70429596a3c6a413b03118b0d800521b3526d99dcf88a48acc3189b51518d82
* | Add the "WITH BLOOM FILTER" clause to the EXPLAIN QUERY PLAN output fordrh2021-12-04
| | | | | | | | | | cases were a Bloom filter is used. FossilOrigin-Name: 8e078c0e404fe4b3661dd4a11a992a8914c99e2a144cecc417421cbd68fa08cc
* | Add a Bloom filter to the automatic-index mechanism.drh2021-12-01
|/ | | FossilOrigin-Name: 50ac4de1d7cbb586ea7969e1ae80ea8b021e194edc2fa7db19374b4ee9369bee
* Proposed fix for a problem associated with OP_SeekScan that results in andrh2021-11-02
| | | | | incorrect answer. See ticket [5981a8c041a3c2f3]. FossilOrigin-Name: 266e9cbada531716c908c21d60a6038109722e3dd040237679ac0240fb5020ea
* Protect the WhereTerm.u union using nearby assert()s and/or branches.drh2021-10-15
| | | FossilOrigin-Name: 8a56de5b9c6f4522000f8d991373490b67b9e9d97f03c1ca2cf32816d84789ef
* Protect access to the WhereLoop.u union using nearby assert()s anddrh2021-10-14
| | | | | branches. FossilOrigin-Name: bdd840216cc4c5293c112f182a189f7562b3cc0f6270e3c4af5eb2e8bd61ccc9
* Protect access to the Expr.y union using nearby assert()s and branches.drh2021-10-07
| | | FossilOrigin-Name: 87e2f5eb436fc448427b0e24fb70f29688796b513b8c7b12f1a21540dae1e56d
* Protect all accesses to the Expr.x union using nearby assert()s and branches.drh2021-10-07
| | | FossilOrigin-Name: 8eaa1d4a98b24adf245bbd2fe9212aa6a924a0f09c445906d7f87574f36a7423
* Fix harmless static-analyzer warnings.drh2021-10-04
| | | FossilOrigin-Name: 32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
* Do not disable a rowid=? term used to drive an IPK index if it is a ↵dan2021-08-30
| | | | | transitive constraint. FossilOrigin-Name: 46e28cbcf6044b36aa4ddcda09adb49a46c6c6a8d41d558467ede3091304aa8c
* Store the collating sequence name for each column of a table as andrh2021-08-05
| | | | | | extension to the column name, for an additional savings in the heap space needed to hold the schema. FossilOrigin-Name: 832ac4c1ee384be0de72a4bdd55ed87e0f8294e7df5eefcf6b4942db3d85a69e
* Refactor field names in the Column object, zCnName and zCnColl, to make themdrh2021-08-02
| | | | | unique and thus easier to find amid all the other code. FossilOrigin-Name: 8b781dcaf68e0cf12a844708c82eee00193e340195cbca915d077e4846983bf3
* Make a deep copy of the result of a subquery in case the subquery isdrh2021-05-28
| | | | | | | | | reused. Fix for the problem reported by [forum:/forumpost/28216b36ac|forum post 28216b36ac] and introduced by check-in [f30fb19ff763a7cb]. Further changes to try to optimize the new OP_Copy opcode back into either OP_SCopy or OP_Move will be attempted separately. A test case will be in TH3. FossilOrigin-Name: c9f0b9cb0aef107265435e22c164dd3c974eadfd00abf7cfd4fc7ec95c0dd7d0
* Update an assert() in wherecode.c that might fail following an unrelated SQL ↵dan2021-05-26
| | | | | error. FossilOrigin-Name: 3e2c36a8272ab3c1777638c0ed8222e7ff04657fe1c40f74a63b99a5a90258cc
* Do not invoke sqlite3ExprAffinity() after a syntax error that might havedrh2021-05-22
| | | | | | left the tree in an inconsistent state. See also [e8a1515b44380cc5] and [forum:/forumpost/7e484e225c|forum post 7e484e225c]. FossilOrigin-Name: b986600520696b0c91c4ccc6aff1b698391b4bcaf8a3ea436be1967883faa2fe
* In the MULTI-INDEX OR query plan, code for sub-expressions can sometimes bedrh2021-05-18
| | | | | | | | generated twice. But for some subqueries, generating code off of the same tree twice causes problems. So now MULTI-INDEX OR makes a copy of the sub-expressions it uses to avoid code-generating them more than once. dbsqlfuzz 9ebd2140e7206ff724e665f172faea28af801635. FossilOrigin-Name: 4a55f72542c8bcc80253aa77043314cecb29d73cb4f51aa80f7811e86cc8ef68
* Further simplification of the reverse-order scan logic of the previousdrh2021-05-12
| | | | | check-in. FossilOrigin-Name: b2b0e23ba885f22c88b03492e42c3cd1cbd59289e452263951bb757a871699f0
* Fix the query plan for an indexed lookup on a WITHOUT ROWID table withdrh2021-05-12
| | | | | | a DESC primary key when the primary key is constrained by an inequality. See [forum:/forumpost/8988341615|forum post 8988341615]. Test cases in TH3. FossilOrigin-Name: f65c929bf189cf5ca5f1cacdbbb8eec014c9960f767b135023bd2323cd26f279
* When applying the optimization that disables WHERE clause terms that drivedrh2021-05-04
| | | | | | | indexes, make sure not to do so if the term being disabled is a transitive constraint. Fix for the problem identified by [forum:forumpost/eb8613976a|forum post eb8613976a]. FossilOrigin-Name: f1f9b5de3c59489b94963685660b3ddc45eece5535b02fec399b6ece0e38563d