summaryrefslogtreecommitdiff
path: root/mysql-test/main/view.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/view.test')
-rw-r--r--mysql-test/main/view.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test
index 9b2baa69e8c..40cc05fd9c2 100644
--- a/mysql-test/main/view.test
+++ b/mysql-test/main/view.test
@@ -6433,6 +6433,36 @@ DROP VIEW v1;
DROP TABLE t1;
--echo #
+--echo # MDEV-24314: create view with derived table without default database
+--echo #
+
+drop database test;
+
+create database db1;
+create table db1.t1 (a int);
+insert into db1.t1 values (3),(7),(1);
+
+create view db1.v1 as select * from (select * from db1.t1) t;
+show create view db1.v1;
+select * from db1.v1;
+drop view db1.v1;
+
+prepare stmt from "
+create view db1.v1 as select * from (select * from db1.t1) t;
+";
+execute stmt;
+deallocate prepare stmt;
+show create view db1.v1;
+select * from db1.v1;
+drop view db1.v1;
+
+drop table db1.t1;
+drop database db1;
+
+create database test;
+use test;
+
+--echo #
--echo # End of 10.2 tests
--echo #