summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/view.result19
-rw-r--r--mysql-test/t/view.test25
2 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 1fae4e6ec9f..e0bc7b3d984 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -6559,5 +6559,24 @@ Warnings:
Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP VIEW v;
#
+# MDEV-13439: Database permissions are not enough to run a subquery
+# with GROUP BY within a view
+#
+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;
+i
+disconnect con1;
+connection default;
+use test;
+drop database test_db;
+drop user foo@localhost;
+#
# End of 10.2 tests
#
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 #