summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-09-11 15:48:34 +0400
committerAlexander Barkov <bar@mariadb.org>2015-09-11 15:48:34 +0400
commitaaf6334b6492ff915070378a61ed6e97881abfda (patch)
tree237373a06cef5c840cb563e662e97b71895ca661 /mysql-test
parent9158212a276cc7cef7907d38ac754773a320a1ec (diff)
downloadmariadb-git-aaf6334b6492ff915070378a61ed6e97881abfda.tar.gz
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.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/row.result22
-rw-r--r--mysql-test/t/row.test18
2 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index f94c958a1be..59a606128f5 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -489,3 +489,25 @@ SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
i
DROP TABLE t1;
End of 5.1 tests
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8709 Row equality elements do not get propagated
+#
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (10,10),(20,20);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND b=10 AND a>=10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+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))
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,b)=(10,10) AND a>=10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+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))
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index fb49ce23644..9268a3e1086 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -285,3 +285,21 @@ SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
DROP TABLE t1;
--echo End of 5.1 tests
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8709 Row equality elements do not get propagated
+--echo #
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (10,10),(20,20);
+# Checking that the a>=10 part gets optimized away in both scalar and row notations
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND b=10 AND a>=10;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,b)=(10,10) AND a>=10;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #