summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect_innodb.test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-09-08 21:54:01 +0300
committerunknown <bell@sanja.is.com.ua>2004-09-08 21:54:01 +0300
commitb9826e10635e222ca758692c6788a5a449e10926 (patch)
treec8b6bdeb3236e4bacaa9793fd4a5dfd89645f984 /mysql-test/t/subselect_innodb.test
parent9b6ca7f3a516267422f4048d48ad1ce78a773c27 (diff)
downloadmariadb-git-b9826e10635e222ca758692c6788a5a449e10926.tar.gz
test case of bug#5220
Diffstat (limited to 'mysql-test/t/subselect_innodb.test')
-rw-r--r--mysql-test/t/subselect_innodb.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 8c13171d221..5f4badb3624 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -111,3 +111,17 @@ create table t2 (a int) engine=innodb;
insert into t2 values (1),(2),(3),(4);
select a, sum(b) as b from t1 group by a having b > (select max(a) from t2);
drop table t1, t2;
+
+#
+# bug #5220 test suite
+#
+CREATE TABLE `t1` ( `unit` varchar(50) NOT NULL default '', `ingredient` varchar(50) NOT NULL default '') ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE `t2` ( `ingredient` varchar(50) NOT NULL default '', `unit` varchar(50) NOT NULL default '', PRIMARY KEY (ingredient, unit)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO `t1` VALUES ('xx','yy');
+INSERT INTO `t2` VALUES ('yy','xx');
+
+SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit);
+
+drop table t1, t2;