diff options
Diffstat (limited to 'mysql-test/main/grant2.result')
-rw-r--r-- | mysql-test/main/grant2.result | 114 |
1 files changed, 49 insertions, 65 deletions
diff --git a/mysql-test/main/grant2.result b/mysql-test/main/grant2.result index ffb41c1b5f8..5d168a04455 100644 --- a/mysql-test/main/grant2.result +++ b/mysql-test/main/grant2.result @@ -1,3 +1,4 @@ +select priv into @root_priv from mysql.global_priv where user='root' and host='localhost'; set GLOBAL sql_mode=""; set LOCAL sql_mode=""; SET NAMES binary; @@ -181,19 +182,19 @@ grant select on *.* to 'mysqltest_2'; grant insert on test.* to 'mysqltest_2'; grant update on test.t1 to 'mysqltest_2'; grant update (c2) on test.t2 to 'mysqltest_2'; -select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; -host user password -% mysqltest_1 -% mysqltest_2 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 -% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff -select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user; +select host,user,password,plugin,authentication_string from mysql.user where user like 'mysqltest_%'; +Host User Password plugin authentication_string +% mysqltest_1 mysql_native_password +% mysqltest_2 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 mysql_native_password *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 +% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff mysql_native_password fffffffffffffffffffffffffffffffffffffffff +select host,db,user from mysql.db where user like 'mysqltest_%'; host db user % test mysqltest_2 -select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name; +select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%'; host db user table_name % test mysqltest_2 t1 % test mysqltest_2 t2 -select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name; +select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%'; host db user table_name column_name % test mysqltest_2 t2 c2 show grants for 'mysqltest_1'; @@ -206,35 +207,35 @@ GRANT INSERT ON "test".* TO 'mysqltest_2'@'%' GRANT UPDATE (c2) ON "test"."t2" TO 'mysqltest_2'@'%' GRANT UPDATE ON "test"."t1" TO 'mysqltest_2'@'%' drop user 'mysqltest_1'; -select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; -host user password -% mysqltest_2 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 -% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff -select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user; +select host,user,password,plugin,authentication_string from mysql.user where user like 'mysqltest_%'; +Host User Password plugin authentication_string +% mysqltest_2 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 mysql_native_password *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 +% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff mysql_native_password fffffffffffffffffffffffffffffffffffffffff +select host,db,user from mysql.db where user like 'mysqltest_%'; host db user % test mysqltest_2 -select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name; +select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%'; host db user table_name % test mysqltest_2 t1 % test mysqltest_2 t2 -select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name; +select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%'; host db user table_name column_name % test mysqltest_2 t2 c2 show grants for 'mysqltest_1'; ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%' rename user 'mysqltest_2' to 'mysqltest_1'; -select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; -host user password -% mysqltest_1 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 -% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff -select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user; +select host,user,password,plugin,authentication_string from mysql.user where user like 'mysqltest_%' ; +Host User Password plugin authentication_string +% mysqltest_1 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 mysql_native_password *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 +% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff mysql_native_password fffffffffffffffffffffffffffffffffffffffff +select host,db,user from mysql.db where user like 'mysqltest_%' ; host db user % test mysqltest_1 -select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name; +select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' ; host db user table_name % test mysqltest_1 t1 % test mysqltest_1 t2 -select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name; +select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' ; host db user table_name column_name % test mysqltest_1 t2 c2 show grants for 'mysqltest_1'; @@ -254,21 +255,21 @@ ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%' revoke all privileges, grant option from 'mysqltest_1'; ERROR HY000: Can't revoke all privileges for one or more of the requested users drop user 'mysqltest_1'; -select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,user; +select host,db,user from mysql.db where user = 'mysqltest_1' ; host db user insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1'; flush privileges; show grants for 'mysqltest_1'; ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%' drop user 'mysqltest_1'; -select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' order by host,db,user,table_name; +select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' ; host db user table_name insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1'; flush privileges; show grants for 'mysqltest_1'; ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%' drop user 'mysqltest_1'; -select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' order by host,db,user,table_name,column_name; +select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' ; host db user table_name column_name create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; @@ -310,7 +311,7 @@ create user mysqltest_2@localhost; grant create user on *.* to mysqltest_2@localhost; connect user3,localhost,mysqltest_2,,; connection user3; -select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; +select host,user,password,plugin,authentication_string from mysql.user where user like 'mysqltest_%' ; ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 'user' create user mysqltest_A@'%'; rename user mysqltest_A@'%' to mysqltest_B@'%'; @@ -326,14 +327,9 @@ show grants; Grants for mysqltest_3@localhost GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' GRANT INSERT, UPDATE, DELETE ON `mysql`.* TO 'mysqltest_3'@'localhost' -select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; +select host,user,password,plugin,authentication_string from mysql.user where user like 'mysqltest_%' ; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 'user' -insert into mysql.user set host='%', user='mysqltest_B'; -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 set host='%', user='mysqltest_B'; create user mysqltest_A@'%'; rename user mysqltest_B@'%' to mysqltest_C@'%'; drop user mysqltest_C@'%'; @@ -373,7 +369,7 @@ set password = password('changed'); disconnect b12302; connection default; select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1'; -host length(authentication_string) +Host length(authentication_string) 127.0.0.1 41 revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.1'; delete from mysql.user where user like 'mysqltest\_1'; @@ -388,7 +384,7 @@ set password = password('changed'); disconnect b12302_2; connection default; select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1'; -host length(authentication_string) +Host length(authentication_string) 127.0.0.0/255.0.0.0 41 revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.0/255.0.0.0'; delete from mysql.user where user like 'mysqltest\_1'; @@ -428,15 +424,10 @@ disconnect con2root; disconnect con3root; 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 (host, user, password) VALUES -('%','mysqltest_1',password('password')); -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 +create temporary table t1 as select * from mysql.global_priv; +delete from mysql.global_priv where host='localhost'; +INSERT INTO mysql.global_priv (host, user, priv) VALUES +('%','mysqltest_1',json_object('authentication_string', password('password'))); INSERT INTO mysql.db (host, db, user, select_priv) VALUES ('%','TESTDB','mysqltest_1','Y'); FLUSH PRIVILEGES; @@ -445,9 +436,9 @@ create database TEStdb; Got one of the listed errors connection default; disconnect con1; -delete from mysql.user; +delete from mysql.global_priv; delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB'; -insert into mysql.user select * from t1; +insert into mysql.global_priv select * from t1; drop table t1, t2; drop database TESTDB; flush privileges; @@ -462,6 +453,8 @@ INSERT INTO t2 VALUES (1); DROP FUNCTION IF EXISTS f2; CREATE FUNCTION f2 () RETURNS INT BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END// +Warnings: +Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead SELECT f2(); f2() 1 @@ -553,27 +546,18 @@ End of 5.0 tests USE mysql; SELECT LEFT(CURRENT_USER(),INSTR(CURRENT_USER(),'@')-1) INTO @u; SELECT MID(CURRENT_USER(),INSTR(CURRENT_USER(),'@')+1) INTO @h; -SELECT password FROM user WHERE user=@u AND host=@h INTO @pwd; -SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; -user host password insert_priv -root localhost Y -UPDATE user SET insert_priv='N' WHERE user=@u AND host=@h; -SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; -user host password insert_priv -root localhost N +SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h; +User Host Password plugin authentication_string Insert_priv +root localhost Y GRANT INSERT ON *.* TO CURRENT_USER(); -SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; -user host password insert_priv -root localhost Y -UPDATE user SET insert_priv='N' WHERE user=@u AND host=@h; +SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h; +User Host Password plugin authentication_string Insert_priv +root localhost mysql_native_password Y GRANT INSERT ON *.* TO CURRENT_USER() IDENTIFIED BY 'keksdose'; -SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; -user host password insert_priv -root localhost *0BB7188CF0DE9B403BA66E9DD810D82652D002EB Y -UPDATE user SET password=@pwd WHERE user=@u AND host=@h; -SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; -user host password insert_priv -root localhost Y +SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h; +User Host Password plugin authentication_string Insert_priv +root localhost *0BB7188CF0DE9B403BA66E9DD810D82652D002EB mysql_native_password *0BB7188CF0DE9B403BA66E9DD810D82652D002EB Y +UPDATE global_priv SET priv=@root_priv; FLUSH PRIVILEGES; USE test; End of 5.1 tests |