diff options
Diffstat (limited to 'mysql-test/main/grant.result')
-rw-r--r-- | mysql-test/main/grant.result | 80 |
1 files changed, 61 insertions, 19 deletions
diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result index 4b639bf969c..46d87a4777f 100644 --- a/mysql-test/main/grant.result +++ b/mysql-test/main/grant.result @@ -2,6 +2,7 @@ set GLOBAL sql_mode=""; set LOCAL sql_mode=""; SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; +select priv into @root_priv from mysql.global_priv where user='root' and host='localhost'; drop table if exists t1; drop database if exists mysqltest; connect master,localhost,root,,; @@ -58,7 +59,7 @@ max_questions 0 max_updates 0 max_connections 0 max_user_connections 0 -plugin +plugin mysql_native_password authentication_string password_expired N is_role N @@ -134,7 +135,7 @@ max_questions 10 max_updates 0 max_connections 0 max_user_connections 0 -plugin +plugin mysql_native_password authentication_string password_expired N is_role N @@ -186,7 +187,7 @@ max_questions 10 max_updates 20 max_connections 30 max_user_connections 0 -plugin +plugin mysql_native_password authentication_string password_expired N is_role N @@ -298,12 +299,7 @@ ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES select 1; 1 1 -insert into mysql.user (host, user) values ('localhost', 'test11'); -Warnings: -Warning 1364 Field 'ssl_cipher' doesn't have a default value -Warning 1364 Field 'x509_issuer' doesn't have a default value -Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value +insert into mysql.global_priv (host, user) values ('localhost', 'test11'); insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); alter table mysql.db order by db asc; @@ -842,9 +838,6 @@ drop database db27515; End of 4.1 tests use test; create table t1 (a int); -create table t2 as select * from mysql.user where user=''; -delete from mysql.user where user=''; -flush privileges; create user mysqltest_8@''; create user mysqltest_8@host8; create user mysqltest_8@''; @@ -854,7 +847,7 @@ ERROR HY000: Operation CREATE USER failed for 'mysqltest_8'@'%' create user mysqltest_8@host8; ERROR HY000: Operation CREATE USER failed for 'mysqltest_8'@'host8' select user, QUOTE(host) from mysql.user where user="mysqltest_8"; -user QUOTE(host) +User QUOTE(host) mysqltest_8 '%' mysqltest_8 'host8' Schema privileges @@ -1044,9 +1037,6 @@ ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host '%' drop user mysqltest_8@host8; show grants for mysqltest_8@host8; ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host 'host8' -insert into mysql.user select * from t2; -flush privileges; -drop table t2; drop table t1; connection master; CREATE DATABASE mysqltest3; @@ -1453,7 +1443,6 @@ CURRENT_USER() root@localhost SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin"); SET PASSWORD FOR CURRENT_USER() = PASSWORD(""); -update mysql.user set plugin=''; # Bug#57952 @@ -1925,7 +1914,7 @@ DROP DATABASE db2; grant usage on Foo.* to myuser@Localhost identified by 'foo'; grant select on Foo.* to myuser@localhost; select host,user from mysql.user where User='myuser'; -host user +Host User localhost myuser revoke select on Foo.* from myuser@localhost; delete from mysql.user where User='myuser'; @@ -2672,6 +2661,38 @@ disconnect conn2; disconnect conn3; DROP USER foo@'127.0.0.1'; # End of Bug#12766319 +create user foo@localhost; +create database foodb; +grant create routine on foodb.* to foo@localhost; +connect con1,localhost,foo; +create procedure fooproc() select 'i am fooproc'; +show grants; +Grants for foo@localhost +GRANT USAGE ON *.* TO 'foo'@'localhost' +GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost' +GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'localhost' +disconnect con1; +connection default; +rename table mysql.procs_priv to mysql.procs_priv1; +flush privileges; +show grants for foo@localhost; +Grants for foo@localhost +GRANT USAGE ON *.* TO 'foo'@'localhost' +GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost' +rename table mysql.procs_priv1 to mysql.procs_priv; +show grants for foo@localhost; +Grants for foo@localhost +GRANT USAGE ON *.* TO 'foo'@'localhost' +GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost' +flush privileges; +show grants for foo@localhost; +Grants for foo@localhost +GRANT USAGE ON *.* TO 'foo'@'localhost' +GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost' +GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'localhost' +drop user foo@localhost; +drop procedure fooproc; +drop database foodb; # # Bug#11756966 - 48958: STORED PROCEDURES CAN BE LEVERAGED TO BYPASS # DATABASE SECURITY @@ -2701,7 +2722,7 @@ DROP USER untrusted@localhost; DROP DATABASE secret; set GLOBAL sql_mode=default; # -# Start of 10.2 tests +# End of 10.1 tests # # # MDEV-10134 Add full support for DEFAULT @@ -2730,3 +2751,24 @@ DROP USER dummy@localhost; # # End of 10.2 tests # +# +# MDEV-17932 : Assertion upon double RENAME USER +# +CREATE USER foo@localhost; +CREATE USER bar2@localhost; +RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost; +DROP USER bar2@localhost; +DROP USER bar3@localhost; +# +# MDEV-17946 : Unsorted acl_dbs after RENAME USER +# +CREATE USER foo; +GRANT SELECT ON test.* TO foo; +RENAME USER '' TO 'name'; +GRANT UPDATE ON test.* TO foo; +RENAME USER 'name' to ''; +DROP USER foo; +# +# End of 10.4 tests +# +update mysql.global_priv set priv=@root_priv where user='root' and host='localhost'; |