summaryrefslogtreecommitdiff
path: root/mysql-test/t/view_grant.test
diff options
context:
space:
mode:
authorGeorgi Kodinov <kgeorge@mysql.com>2009-02-25 12:19:29 +0200
committerGeorgi Kodinov <kgeorge@mysql.com>2009-02-25 12:19:29 +0200
commit620438fdaef079216609bfcb0a8cb7b58c950e1e (patch)
treeb87b94d4e99c05d39b544d049937c8e376a8e9dc /mysql-test/t/view_grant.test
parente60b9650c0ec3e956141710bd141d001abb831fb (diff)
downloadmariadb-git-620438fdaef079216609bfcb0a8cb7b58c950e1e.tar.gz
backport the fix for bug #37191 to 5.1-bugteam
Diffstat (limited to 'mysql-test/t/view_grant.test')
-rw-r--r--mysql-test/t/view_grant.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index 4e8d97e4444..f3794a6ba73 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -1218,6 +1218,44 @@ SHOW CREATE VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug#37191: Failed assertion in CREATE VIEW
+#
+CREATE USER mysqluser1@localhost;
+CREATE DATABASE mysqltest1;
+
+USE mysqltest1;
+
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( b INT );
+
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (1), (2);
+
+GRANT CREATE VIEW ON mysqltest1.* TO mysqluser1@localhost;
+
+GRANT SELECT ON t1 TO mysqluser1@localhost;
+GRANT INSERT ON t2 TO mysqluser1@localhost;
+
+--connect (connection1, localhost, mysqluser1, , mysqltest1)
+
+--echo This would lead to failed assertion.
+CREATE VIEW v1 AS SELECT a, b FROM t1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT b FROM v1;
+
+--disconnect connection1
+--connection default
+
+DROP TABLE t1, t2;
+DROP VIEW v1;
+DROP DATABASE mysqltest1;
+DROP USER mysqluser1@localhost;
+USE test;
+
--echo End of 5.1 tests.
#