summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 4430b65e5f4..47dc62c1b96 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -6269,5 +6269,30 @@ SHOW CREATE VIEW v;
DROP VIEW v;
--echo #
+--echo # MDEV-13439: Database permissions are not enough to run a subquery
+--echo # with GROUP BY within a view
+--echo #
+
+create database test_db;
+use test_db;
+create table t (i int);
+
+create user foo@localhost;
+grant all on test_db.* to foo@localhost;
+
+--connect (con1,localhost,foo,,)
+
+use test_db;
+create view v as select * from (select i from t group by i) sq;
+select * from v;
+
+# Cleanup
+--disconnect con1
+--connection default
+use test;
+drop database test_db;
+drop user foo@localhost;
+
+--echo #
--echo # End of 10.2 tests
--echo #