Skip to content

Commit aaf6334

Browse files
author
Alexander Barkov
committed
MDEV-8709 Row equality elements do not get propagated
The problem was fixed earlier by one of the MDEV-8728 subtasks. Adding a test case only.
1 parent 9158212 commit aaf6334

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

mysql-test/r/row.result

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,3 +489,25 @@ SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
489489
i
490490
DROP TABLE t1;
491491
End of 5.1 tests
492+
#
493+
# Start of 10.1 tests
494+
#
495+
#
496+
# MDEV-8709 Row equality elements do not get propagated
497+
#
498+
CREATE TABLE t1 (a INT, b INT);
499+
INSERT INTO t1 VALUES (10,10),(20,20);
500+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND b=10 AND a>=10;
501+
id select_type table type possible_keys key key_len ref rows filtered Extra
502+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
503+
Warnings:
504+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`b` = 10))
505+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,b)=(10,10) AND a>=10;
506+
id select_type table type possible_keys key key_len ref rows filtered Extra
507+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
508+
Warnings:
509+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`b` = 10))
510+
DROP TABLE t1;
511+
#
512+
# End of 10.1 tests
513+
#

mysql-test/t/row.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,21 @@ SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
285285
DROP TABLE t1;
286286

287287
--echo End of 5.1 tests
288+
289+
--echo #
290+
--echo # Start of 10.1 tests
291+
--echo #
292+
293+
--echo #
294+
--echo # MDEV-8709 Row equality elements do not get propagated
295+
--echo #
296+
CREATE TABLE t1 (a INT, b INT);
297+
INSERT INTO t1 VALUES (10,10),(20,20);
298+
# Checking that the a>=10 part gets optimized away in both scalar and row notations
299+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND b=10 AND a>=10;
300+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,b)=(10,10) AND a>=10;
301+
DROP TABLE t1;
302+
303+
--echo #
304+
--echo # End of 10.1 tests
305+
--echo #

0 commit comments

Comments
 (0)