summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant.test
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@hfmain.(none)>2007-05-12 00:22:15 +0500
committerunknown <holyfoot/hf@hfmain.(none)>2007-05-12 00:22:15 +0500
commit2e3baa6844425290c56ea2cb1ac32d4171792377 (patch)
tree355abea4a480af1654e33a48c828b9517ae544ae /mysql-test/t/grant.test
parentee7677d125ac91429bab45d2943f531400adc4d1 (diff)
parentbd311c0c44ee3c5271665a08f0825e9da8c92913 (diff)
downloadmariadb-git-2e3baa6844425290c56ea2cb1ac32d4171792377.tar.gz
Merge mysql.com:/home/hf/work/27957/my50-27957
into mysql.com:/home/hf/work/27957/my51-27957 mysql-test/t/grant.test: Auto merged mysql-test/r/grant.result: merging sql/sql_update.cc: Auto merged sql/sql_prepare.cc: Auto merged
Diffstat (limited to 'mysql-test/t/grant.test')
-rw-r--r--mysql-test/t/grant.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index d2b384b6559..20b4aa72456 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -415,6 +415,7 @@ connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
-- error 1142
alter table t1 rename t2;
+disconnect user1;
connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
@@ -1235,6 +1236,30 @@ DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
+#
+# Bug#27878: Unchecked privileges on a view referring to a table from another
+# database.
+#
+use test;
+CREATE TABLE t1 (f1 int, f2 int);
+INSERT INTO t1 VALUES(1,1), (2,2);
+CREATE DATABASE db27878;
+GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
+GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
+GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
+use db27878;
+CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
+connect (user1,localhost,mysqltest_1,,test);
+connection user1;
+use db27878;
+--error 1356
+UPDATE v1 SET f2 = 4;
+SELECT * FROM test.t1;
+disconnect user1;
+connection default;
+DROP VIEW v1;
+use test;
+DROP TABLE t1;
--echo End of 5.0 tests