File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2115,4 +2115,35 @@ a b
211521150 0
211621161 1
21172117drop table t2;
2118+ #
2119+ # MDEV-10228: Delete missing rows with OR conditions
2120+ # (The example uses UPDATE, because UPDATE allows to use index hints
2121+ # and so it's possible to make an example that works with any storage
2122+ # engine)
2123+ #
2124+ CREATE TABLE t1 (
2125+ key1varchar varchar(14) NOT NULL,
2126+ key2int int(11) NOT NULL DEFAULT '0',
2127+ col1 int,
2128+ PRIMARY KEY (key1varchar,key2int),
2129+ KEY key1varchar (key1varchar),
2130+ KEY key2int (key2int)
2131+ ) DEFAULT CHARSET=utf8;
2132+ insert into t1 values
2133+ ('value1',0, 0),
2134+ ('value1',1, 0),
2135+ ('value1',1000685, 0),
2136+ ('value1',1003560, 0),
2137+ ('value1',1004807, 0);
2138+ update t1 force index (PRIMARY) set col1=12345
2139+ where (key1varchar='value1' AND (key2int <=1 OR key2int > 1));
2140+ # The following must show col1=12345 for all rows:
2141+ select * from t1;
2142+ key1varchar key2int col1
2143+ value1 0 12345
2144+ value1 1 12345
2145+ value1 1000685 12345
2146+ value1 1003560 12345
2147+ value1 1004807 12345
2148+ drop table t1;
21182149set optimizer_switch=@mrr_icp_extra_tmp;
You can’t perform that action at this time.
0 commit comments