1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
Sergei Petrunia
2016-06-22 23:20:41 +03:00
parent 63120090f9
commit 3e03b89b0a
4 changed files with 32 additions and 0 deletions

View File

@@ -2288,5 +2288,16 @@ Warnings:
Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1 Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1
DROP TABLE t1; 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 # End of 10.1 tests
# #

View File

@@ -2290,6 +2290,17 @@ Warnings:
Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1 Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1
DROP TABLE t1; 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 # End of 10.1 tests
# #
set optimizer_switch=@mrr_icp_extra_tmp; set optimizer_switch=@mrr_icp_extra_tmp;

View File

@@ -1816,6 +1816,15 @@ INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e');
EXPLAIN SELECT * FROM t1 WHERE a<=>'😎'; EXPLAIN SELECT * FROM t1 WHERE a<=>'😎';
DROP TABLE t1; 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 #
--echo # End of 10.1 tests --echo # End of 10.1 tests
--echo # --echo #

View File

@@ -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. for e.g. "key IN (c1, ..., cN)" which produces a lot of ranges.
*/ */
result= tree1; result= tree1;
result->keys_map.clear_all();
} }
else else
{ {