summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant2.test
diff options
context:
space:
mode:
authormsvensson@devsrv-b.mysql.com <>2006-02-27 16:41:58 +0100
committermsvensson@devsrv-b.mysql.com <>2006-02-27 16:41:58 +0100
commit706070fbf8455d0ee01de8eff4a9ef921df518de (patch)
treefd8437ac8876f1ce7113d7ee39c46cf187196be1 /mysql-test/t/grant2.test
parenta77cc69e6203b03f6a43c874b6e8e5f5b0797ccb (diff)
downloadmariadb-git-706070fbf8455d0ee01de8eff4a9ef921df518de.tar.gz
Bug#17279 user with no global privs and with create priv in db can create databases
- Use binary charset in acl_cache, to make searches case sensitive - Add testcase
Diffstat (limited to 'mysql-test/t/grant2.test')
-rw-r--r--mysql-test/t/grant2.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 430a3a5dd4a..32861d1b184 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -429,3 +429,38 @@ disconnect con2root;
disconnect con3root;
# End of 4.1 tests
+
+#
+# Bug#17279 user with no global privs and with create
+# priv in db can create databases
+#
+
+create database TESTDB;
+create table t2(a int);
+create temporary table t1 as select * from mysql.user;
+delete from mysql.user where host='localhost';
+INSERT INTO mysql.user VALUES
+('%','mysqltest_1',password('password'),'N','N','N','N','N','N',
+'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N',
+'','','','',0,0,0,0);
+INSERT INTO mysql.db VALUES
+('%','TESTDB','mysqltest_1','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','N','Y','Y','Y','
+Y','N');
+FLUSH PRIVILEGES;
+
+connect (con1,localhost,mysqltest_1,password,TESTDB);
+
+# The user mysqltest_1 should only be allowed access to
+# database TESTDB, not TEStdb
+--error 1044
+create database TEStdb;
+
+# Clean-up
+connection default;
+delete from mysql.user;
+delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB';
+insert into mysql.user select * from t1;
+drop table t1, t2;
+drop database TESTDB;
+flush privileges;
+