Commit 3e03b89b authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in

Make tree_or set correct SEL_TREE::keys_map for the result.
parent 63120090
......@@ -2288,5 +2288,16 @@ Warnings:
Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1
DROP TABLE t1;
#
# MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in
# sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*)
#
CREATE TABLE t1 (pk INT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5;
pk
1
2
DROP TABLE t1;
#
# End of 10.1 tests
#
......@@ -2290,6 +2290,17 @@ Warnings:
Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1
DROP TABLE t1;
#
# MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in
# sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*)
#
CREATE TABLE t1 (pk INT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5;
pk
1
2
DROP TABLE t1;
#
# End of 10.1 tests
#
set optimizer_switch=@mrr_icp_extra_tmp;
......@@ -1816,6 +1816,15 @@ INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e');
EXPLAIN SELECT * FROM t1 WHERE a<=>'😎';
DROP TABLE t1;
--echo #
--echo # MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in
--echo # sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*)
--echo #
CREATE TABLE t1 (pk INT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5;
DROP TABLE t1;
--echo #
--echo # End of 10.1 tests
--echo #
......@@ -8580,6 +8580,7 @@ tree_or(RANGE_OPT_PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2)
for e.g. "key IN (c1, ..., cN)" which produces a lot of ranges.
*/
result= tree1;
result->keys_map.clear_all();
}
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment