Commit Graph

18 Commits

Author SHA1 Message Date
drh
5d742e39d9 Proposed fix for a problem associated with OP_SeekScan that results in an
incorrect answer.  See ticket [5981a8c041a3c2f3].

FossilOrigin-Name: 266e9cbada531716c908c21d60a6038109722e3dd040237679ac0240fb5020ea
2021-11-02 20:52:20 +00:00
drh
4422b3a646 The OP_ReopenIdx opcode should clear the cursor if the cursor is being
reused.  This prevents leaving the cursor in an initialized state which
could cause problems for a subsequent OP_SeekScan opcode.
Fix for ticket [6dcbfd11cf666e21] and the OP_SeekScan optimization
of check-in [4a43430fd23f8835].

FossilOrigin-Name: d4bf5243f2bf0a2bc77ad12f3e1e4797cb62f2745f9d54eee5f675c3b5f80880
2021-06-25 14:48:24 +00:00
drh
0d08402f34 The opcode that preceeds OP_SeekScan is usually OP_IdxGT but can sometimes
be OP_IdxGE.  Adjust asserts accordingly.  Follow-up to
[9a2ab6092d644fc3].  dbsqlfuzz e41762333a4d6e90a49e628f488d0873b2dba4c5

FossilOrigin-Name: d6803ed8dc4b1eb4d4dc100728acb4a4aa1479732f0fcb94eb23b7f7702ef65c
2021-06-13 19:14:14 +00:00
drh
9966439879 Fix an ALWAYS which can be false.
FossilOrigin-Name: a87f8ecd6db11ea40a15314b875fc78289c19ab2dec6f738b4bf37f4aafa7bbd
2021-06-02 18:50:39 +00:00
drh
eda790d28b Never use WHERE_IN_SEEKSCAN for the 2nd or subsequent IN operator.
FossilOrigin-Name: d0b98619082038ed451912bcdf56568835a8577989a25cacf25591f2366d4f52
2021-06-02 17:14:50 +00:00
drh
8210233c7b Revise tests cases to align with the new EXPLAIN QUERY PLAN output.
FossilOrigin-Name: 50fbd532602d2c316813046ed6be8be2991c281eb5f295c4c28520a0de73862c
2021-03-20 15:11:29 +00:00
dan
df1b52e727 Ensure a cursor used by the SeekScan operator does not point to a valid row on the first iteration of the loop. Possible fix for [2d6e8400].
FossilOrigin-Name: 390cf60a286b13f454429f4652a133f95a7891a75c1ec6d16cd39990590fd3fb
2021-01-27 17:15:06 +00:00
drh
6f2180d21a New test cases in test/in4.test require rtree, so disable those tests on
builds that lack the rtree extension.

FossilOrigin-Name: b5900914f7f34caf1a97c87233781d55467329b0ac4366354df13c6fd72a99c7
2020-01-04 17:42:27 +00:00
dan
74ebaadcdd Fix a problem where the loop for the RHS of a LEFT JOIN uses values from an IN() clause as the second or subsequent field of an index.
FossilOrigin-Name: 95ef68966c50f311830cba8c9257a4085c93011d205e0e31867c2917fa62a48e
2020-01-04 16:55:57 +00:00
drh
790b37a240 Omit the "x IN (y)" to "x==y" optimization of check-in [e68b427afbc82e20]
(and ticket [e39d032577df6942]) as it causes difficult affinity problems
as demonstrated by ticket [dbaf8a6820be1ece] and the original assertion fault
is no longer a factor due to countless other changes of the previous 5 years.

FossilOrigin-Name: 7f5168a76a400fc2e1e40c6950470b1bfb38a0be54fc5518c17c29fdae7d8f1f
2019-08-27 17:01:07 +00:00
drh
bb53ecb1db Enhancements to the code generator for the IN operator that result in much
faster queries in some cases, for example when the RHS of the IN operator
changes for each row of a large table scan.

FossilOrigin-Name: 436e884215e2b33ca3fbb555362237b12827c07a
2014-08-02 21:03:33 +00:00
drh
fbb24d1092 The "x IN (?)" optimization in check-ins [2ff3b25f40] and [e68b427afb] is
incorrect, as demonstrated by the in4-5.1 test case in this check-in.
The "COLLATE binary" that was being added to the RHS of IN was overriding
the implicit collating sequence of the LHS.  This change defines the EP_Generic
expression node property that blocks all affinity or collating sequence
information in the expression subtree and adds that property to the expression
taken from RHS of the IN operator.

FossilOrigin-Name: 2ea4a9f75f46eaa928ba17e9e91bc0432750d46d
2014-03-20 17:03:30 +00:00
drh
0a8d14261c Previous check-in is not quite correct. "x IN (?)" is not exactly the same
as "x==?" do to collation and affinity issues.  The correct converstion should
be to "x==(+? COLLATE binary)".  The current check-in fixes this problem and
provides test cases.  Ticket [e39d032577df69]

FossilOrigin-Name: 2ff3b25f40fd117c8a2da1d1a3625f6b167b7b16
2014-03-20 14:56:47 +00:00
drh
2b59b3a4c8 Convert expressions of the form "X IN (?)" with exactly one value on the
RHS of the IN into equality tests:  "X=?".  Add test cases to verify that
statements work correctly on this corner case.
Fix for ticket [e39d032577df6942].

FossilOrigin-Name: e68b427afbc82e201c64474117851aa4c9eb0c92
2014-03-20 13:26:47 +00:00
drh
dda70fe38e Remove leftover "breakpoint" commands from test scripts. Also remove blank
lines at the end of scripts. (CVS 6721)

FossilOrigin-Name: 1fef16ec2b89981770cf44f606a420fbe031a7a4
2009-06-05 17:09:11 +00:00
danielk1977
25f42fe7a1 Remove incorrect ALWAYS macro associated with empty IN() sets. Ticket #3602. (CVS 6202)
FossilOrigin-Name: f3c09a0cb8bfc1a112c31b556d8921d5c75c5eef
2009-01-24 09:56:15 +00:00
shane
481e9f2089 Added test case to in4.test to try and duplicate crash reported on the mailing list. (CVS 5951)
FossilOrigin-Name: 8502fba37bb13c019252d0a65973a78982ec44aa
2008-11-24 15:32:00 +00:00
danielk1977
41a05b7bee Optimize queries that contain "WHERE rowid IN (x, y, z...)" by using an intkey btree to store the (x, y, z...) set instead of an index btree. (CVS 5760)
FossilOrigin-Name: 803a1736d56b3c07b8ad38715fe0e39196ecc507
2008-10-02 13:50:55 +00:00