summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/subselect.result9
-rw-r--r--mysql-test/t/subselect.test6
2 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 882a8e054c0..0cbf341e55c 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -988,3 +988,12 @@ t1 CREATE TABLE `t1` (
`a` bigint(17) NOT NULL default '0'
) TYPE=MyISAM CHARSET=latin1
drop table t1;
+create table t1 (a int);
+insert into t1 values (1), (2), (3);
+explain select a,(select (select rand() from t1 limit 1) from t1 limit 1)
+from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3
+2 UNCACHEABLE SUBSELECT t1 ALL NULL NULL NULL NULL 3
+3 UNCACHEABLE SUBSELECT t1 ALL NULL NULL NULL NULL 3
+drop table t1;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 6a6133bc924..03575858c3e 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -575,3 +575,9 @@ drop table t1;
CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a;
SHOW CREATE TABLE t1;
drop table t1;
+
+create table t1 (a int);
+insert into t1 values (1), (2), (3);
+explain select a,(select (select rand() from t1 limit 1) from t1 limit 1)
+from t1;
+drop table t1;