summaryrefslogtreecommitdiff
path: root/mysql-test/t/show_check.test
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2004-04-06 20:26:35 +0500
committerunknown <vva@eagle.mysql.r18.ru>2004-04-06 20:26:35 +0500
commit6c3106456def1ba07d0aa2610be615222095df7f (patch)
treefc7e911626b022edc773e5c551802d4b88b37bf5 /mysql-test/t/show_check.test
parentf8b790d0271213ebc881ccdcd22e1a6ecdd2b20f (diff)
downloadmariadb-git-6c3106456def1ba07d0aa2610be615222095df7f.tar.gz
fixed
bug #3342 "SHOW CREATE DATABASE seems to require DROP privilege" (now it require only SELECT privilege on database) mysql-test/r/show_check.result: added test for bug #3342 "SHOW CREATE DATABASE seems to require DROP privilege" mysql-test/t/show_check.test: added test for bug #3342 "SHOW CREATE DATABASE seems to require DROP privilege"
Diffstat (limited to 'mysql-test/t/show_check.test')
-rw-r--r--mysql-test/t/show_check.test48
1 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 638626a7456..b0307af19bb 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -256,3 +256,51 @@ delete from t3 where a=5;
show table status;
drop table t1, t2, t3;
+
+#
+# Test for bug #3342 SHOW CREATE DATABASE seems to require DROP privilege
+#
+
+create database test_$1;
+show create database test_$1;
+create table test_$1.t1(a int);
+insert into test_$1.t1 values(1);
+grant select on `test_$1`.* to mysqltest_1@localhost;
+grant usage on `test_$1`.* to mysqltest_2@localhost;
+grant drop on `test_$1`.* to mysqltest_3@localhost;
+
+connect (con1,localhost,mysqltest_1,,test_$1);
+connection con1;
+select * from t1;
+show create database test_$1;
+--error 1044
+drop table t1;
+--error 1044
+drop database test_$1;
+
+connect (con2,localhost,mysqltest_2,,test);
+connection con2;
+--error 1044
+select * from test_$1.t1;
+--error 1044
+show create database test_$1;
+--error 1044
+drop table test_$1.t1;
+--error 1044
+drop database test_$1;
+
+connect (con3,localhost,mysqltest_3,,test);
+connection con3;
+--error 1044
+select * from test_$1.t1;
+--error 1044
+show create database test_$1;
+drop table test_$1.t1;
+drop database test_$1;
+
+connection default;
+delete from mysql.user
+where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
+delete from mysql.db
+where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
+flush privileges;