Commit d39dbd10 authored by Alexey Kopytov's avatar Alexey Kopytov

Automerge.

parents 2c379a1e 756076bd
......@@ -1653,4 +1653,17 @@ a b
0 0
1 1
DROP TABLE t1;
#
# Bug #54802: 'NOT BETWEEN' evaluation is incorrect
#
CREATE TABLE t1 (c_key INT, c_notkey INT, KEY(c_key));
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
EXPLAIN SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL c_key NULL NULL NULL 3 Using where
SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key;
c_key c_notkey
1 1
3 3
DROP TABLE t1;
End of 5.1 tests
......@@ -1313,4 +1313,16 @@ SELECT * FROM t1 FORCE INDEX (PRIMARY)
DROP TABLE t1;
--echo #
--echo # Bug #54802: 'NOT BETWEEN' evaluation is incorrect
--echo #
CREATE TABLE t1 (c_key INT, c_notkey INT, KEY(c_key));
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
EXPLAIN SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key;
SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key;
DROP TABLE t1;
--echo End of 5.1 tests
......@@ -5620,7 +5620,11 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
SEL_TREE *tmp= get_full_func_mm_tree(param, cond_func,
field_item, (Item*)(intptr)i, inv);
if (inv)
{
tree= !tree ? tmp : tree_or(param, tree, tmp);
if (tree == NULL)
break;
}
else
tree= tree_and(param, tree, tmp);
}
......
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