summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect_innodb.test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-06-09 23:32:20 +0300
committerunknown <bell@sanja.is.com.ua>2004-06-09 23:32:20 +0300
commit07b5fdbcdb656b46c83d3585dc548107b5711609 (patch)
tree245eec6a233c1233f75284cfd2d619b0afe4c28b /mysql-test/t/subselect_innodb.test
parent5304a03e997d520a60d98a5e27da92a0d3efb8d0 (diff)
downloadmariadb-git-07b5fdbcdb656b46c83d3585dc548107b5711609.tar.gz
do not unlock tables early if we have subquery in HAVING clause (BUG#3984)
mysql-test/r/subselect_innodb.result: test of unlocking innodb tables and subquery in HAVING clause mysql-test/t/subselect_innodb.test: test of unlocking innodb tables and subquery in HAVING clause sql/item_subselect.cc: mark SELECT with subquery in HAVING clause sql/sql_lex.cc: mark SELECT with subquery in HAVING clause sql/sql_lex.h: mark SELECT with subquery in HAVING clause sql/sql_select.cc: do not unlock tables early if we have subquery in HAVING clause
Diffstat (limited to 'mysql-test/t/subselect_innodb.test')
-rw-r--r--mysql-test/t/subselect_innodb.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 47642832158..8c13171d221 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -101,3 +101,13 @@ insert into t2 values (1,'z'),(2,'x');
select t2.id,t2.value,(select t1.value from t1 where t1.id=t2.id) from t2;
select t2.id,t2.value,(select t1.value from t1 where t1.id=t2.id) from t2;
drop table t1,t2;
+
+#
+# unlocking tables with subqueries in HAVING
+#
+create table t1 (a int, b int) engine=innodb;
+insert into t1 values (1,2), (1,3), (2,3), (2,4), (2,5), (3,4), (4,5), (4,100);
+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;