summaryrefslogtreecommitdiff
path: root/mysql-test/t/derived.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/derived.test')
-rw-r--r--mysql-test/t/derived.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index a1456246e94..962cec95add 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -303,4 +303,15 @@ SELECT 0 FROM
(SELECT 0) t56, (SELECT 0) t57, (SELECT 0) t58, (SELECT 0) t59, (SELECT 0) t60,
(SELECT 0) t61; # 61 == MAX_TABLES
+--echo #
+--echo # A nested materialized derived table is used before being populated.
+--echo # (addon for bug#19077)
+--echo #
+
+CREATE TABLE t1 (i INT, j BIGINT);
+INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2);
+SELECT * FROM (SELECT MIN(i) FROM t1
+WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3;
+DROP TABLE t1;
+
--echo # End of 5.0 tests