summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant2.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/grant2.test')
-rw-r--r--mysql-test/t/grant2.test21
1 files changed, 10 insertions, 11 deletions
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 7aefbb5d9ff..ffeea70763a 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -18,6 +18,7 @@ flush privileges;
grant all privileges on `my\_1`.* to mysqltest_1@localhost with grant option;
+grant create user on *.* to mysqltest_1@localhost;
create user mysqltest_2@localhost;
connect (user_a,localhost,mysqltest_1,,);
connection user_a;
@@ -30,7 +31,6 @@ grant update on mysql.* to mysqltest_1@localhost;
connect (user_b,localhost,mysqltest_1,,);
connection user_b;
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
---error 1211
grant select on `my\_1`.* to mysqltest_3@localhost;
disconnect user_b;
connection default;
@@ -52,6 +52,7 @@ flush privileges;
#
grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option;
+grant create user on *.* to mysqltest_1@localhost;
connect (user1,localhost,mysqltest_1,,);
connection user1;
select current_user();
@@ -68,7 +69,6 @@ set @@sql_mode='NO_AUTO_CREATE_USER';
select @@sql_mode;
--error 1211
grant select on `my\_1`.* to mysqltest_4@localhost with grant option;
---error 1211
grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass'
with grant option;
disconnect user1;
@@ -248,9 +248,10 @@ show grants for '%@b'@'b';
show grants for '%@a'@'a';
drop user '%@a'@'a';
#
-# USAGE WITH GRANT OPTION is sufficient.
+# CREATE USER privilege is enough
+#
create user mysqltest_2@localhost;
-grant usage on *.* to mysqltest_2@localhost with grant option;
+grant create user on *.* to mysqltest_2@localhost;
connect (user2,localhost,mysqltest_2,,);
connection user2;
--error 1142
@@ -262,22 +263,20 @@ disconnect user2;
connection default;
drop user mysqltest_2@localhost;
#
-# ALL PRIVILEGES without GRANT OPTION is not sufficient.
+# INSERT/UPDATE/DELETE is ok too
create user mysqltest_3@localhost;
-grant all privileges on mysql.* to mysqltest_3@localhost;
+grant INSERT,DELETE,UPDATE on mysql.* to mysqltest_3@localhost;
connect (user3,localhost,mysqltest_3,,);
connection user3;
+show grants;
+--error 1142
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
insert into mysql.user set host='%', user='mysqltest_B';
---error 1044
create user mysqltest_A@'%';
---error 1044
rename user mysqltest_B@'%' to mysqltest_C@'%';
---error 1044
-drop user mysqltest_B@'%';
+drop user mysqltest_C@'%';
disconnect user3;
connection default;
-drop user mysqltest_B@'%';
drop user mysqltest_3@localhost;
#
# Bug #3309: Test IP addresses with netmask