diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2017-08-07 13:42:35 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-08-10 10:17:08 +0200 |
commit | cb2a57c2036ba09ba28d413aa5f171cb25cb36f5 (patch) | |
tree | 54300e579ee967a55f6605a04450d500c16a72fd /mysql-test | |
parent | bdab49d389821724659847a944c6f403deddd430 (diff) | |
download | mariadb-git-cb2a57c2036ba09ba28d413aa5f171cb25cb36f5.tar.gz |
MDEV-13439: Database permissions are not enough to run a subquery with GROUP BY within a view
The bug is result adding ability to have derived tables inside views.
Fixed checks should be a switch between view/derived or select derived and information schema.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/view.result | 19 | ||||
-rw-r--r-- | mysql-test/t/view.test | 25 |
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 # |