summaryrefslogtreecommitdiff
path: root/mysql-test/t/view_grant.test
diff options
context:
space:
mode:
authorunknown <gkodinov@mysql.com>2006-05-26 11:49:39 +0300
committerunknown <gkodinov@mysql.com>2006-05-26 11:49:39 +0300
commit419ae6cbf8ce04430673174e4a0063eda4e90254 (patch)
treea6e1e57b9c8be0e4046fd68ea9fcac02e357f0fb /mysql-test/t/view_grant.test
parent48fe5a2d8feef07b50d8cda323bff706e90ce1c0 (diff)
downloadmariadb-git-419ae6cbf8ce04430673174e4a0063eda4e90254.tar.gz
Bug #14875: Bad view DEFINER makes SHOW CREATE VIEW fail
When reading a view definition from a .frm file it was throwing a SQL error if the DEFINER user is not defined. Changed it to a warning to match the (documented) case when a view with undefined DEFINER user is created. mysql-test/r/view_grant.result: test case for the bug mysql-test/t/view_grant.test: test case for the bug sql/sql_acl.cc: Initialized the members to no privileges so even if the subsequent checks fail it will still initialize the security context. sql/table.cc: Turned the error of undefined DEFINER user in reading a view definition to a warning.
Diffstat (limited to 'mysql-test/t/view_grant.test')
-rw-r--r--mysql-test/t/view_grant.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index e80e1770ba2..e7148418ac5 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -712,3 +712,17 @@ show create view v1;
show create view v2;
drop view v1;
drop view v2;
+
+#
+# BUG#14875: Bad view DEFINER makes SHOW CREATE VIEW fail
+#
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1), (2), (3);
+CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
+--warning 1448
+SHOW CREATE VIEW v;
+--error 1449
+SELECT * FROM v;
+DROP VIEW v;
+DROP TABLE t1;
+USE test;