summaryrefslogtreecommitdiff
path: root/mysql-test/r/table_elim.result
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-05-04 22:00:24 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-04 22:00:24 +0200
commit49c853fb948aeaeb5c7e3f02da3f14da51ee4100 (patch)
tree8c3d487a02209cc0c6f126144f1340fc5897d527 /mysql-test/r/table_elim.result
parentae18a28500974351cf42fa3cac67c83e0647d510 (diff)
parent4c87f727734955f9e4a0ffde25aae4d43ec0b2a5 (diff)
downloadmariadb-git-49c853fb948aeaeb5c7e3f02da3f14da51ee4100.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysql-test/r/table_elim.result')
-rw-r--r--mysql-test/r/table_elim.result32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result
index ff488fea427..c633261bcd3 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -677,3 +677,35 @@ USA
CAN
DROP TABLE t1, t2, t3;
SET optimizer_switch=@save_optimizer_switch;
+#
+# MDEV-7893: table_elimination works wrong with on computed expression and compound unique key
+# (just a testcase)
+CREATE TABLE t1 (
+PostID int(10) unsigned NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1266 Using storage engine MyISAM for table 't1'
+INSERT INTO t1 (PostID) VALUES (1), (2);
+CREATE TABLE t2 (
+VoteID int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
+EntityID int(10) unsigned NOT NULL,
+UserID int(10) unsigned NOT NULL,
+UNIQUE KEY EntityID (EntityID,UserID)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1266 Using storage engine MyISAM for table 't2'
+INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30);
+SELECT t1.*, T.Voted as Voted
+FROM
+t1 LEFT JOIN (
+SELECT 1 AS Voted, EntityID
+FROM t2
+WHERE t2.UserID = '20' ) AS T
+ON T.EntityID = t1.PostID
+WHERE t1.PostID='1'
+LIMIT 1;
+PostID Voted
+1 NULL
+DROP TABLE t1,t2;