Commit 76151f3c authored by Sergei Golubchik's avatar Sergei Golubchik

Use mysql.user.authentication_string for password

Don't distinguish between a "password hash" and "authentication string"
anymore. Now both are stored in mysql.user.authentication_string, both
are handled identically internally. A "password hash" is just how some
particular plugins interpret authentication string.

Set mysql.user.plugin even if there is no password. The server will use
mysql_native_password plugin in these cases, let's make it expicit.

Remove LEX_USER::pwhash.
parent 0e388d43
This diff is collapsed.
...@@ -98,7 +98,7 @@ ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) ...@@ -98,7 +98,7 @@ ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET);
connect fail_con,localhost,test,zorro,; connect fail_con,localhost,test,zorro,;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
update mysql.user set password=old_password("gambling2") where user=_binary"test"; update mysql.user set plugin="", authentication_string="", password=old_password("gambling2") where user=_binary"test";
flush privileges; flush privileges;
connect con10,localhost,test,gambling2,; connect con10,localhost,test,gambling2,;
connect con5,localhost,test,gambling2,mysql; connect con5,localhost,test,gambling2,mysql;
...@@ -364,8 +364,8 @@ update mysql.user set plugin='mysql_old_password' where user = 'mysqltest_up2'; ...@@ -364,8 +364,8 @@ update mysql.user set plugin='mysql_old_password' where user = 'mysqltest_up2';
select user, password, plugin, authentication_string from mysql.user select user, password, plugin, authentication_string from mysql.user
where user like 'mysqltest_up_'; where user like 'mysqltest_up_';
user password plugin authentication_string user password plugin authentication_string
mysqltest_up1 *E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB mysql_native_password mysqltest_up1 mysql_native_password *E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB
mysqltest_up2 09301740536db389 mysql_old_password mysqltest_up2 mysql_old_password 09301740536db389
flush privileges; flush privileges;
connect pcon6,localhost,mysqltest_up1,bar,,$MASTER_MYPORT,; connect pcon6,localhost,mysqltest_up1,bar,,$MASTER_MYPORT,;
connection pcon6; connection pcon6;
......
...@@ -66,7 +66,7 @@ connect (fail_con,localhost,test,zorro,test2); ...@@ -66,7 +66,7 @@ connect (fail_con,localhost,test,zorro,test2);
connect (fail_con,localhost,test,zorro,); connect (fail_con,localhost,test,zorro,);
# check if old password version also works # check if old password version also works
update mysql.user set password=old_password("gambling2") where user=_binary"test"; update mysql.user set plugin="", authentication_string="", password=old_password("gambling2") where user=_binary"test";
flush privileges; flush privileges;
connect (con10,localhost,test,gambling2,); connect (con10,localhost,test,gambling2,);
......
CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw1'; CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw1';
SELECT password FROM mysql.user WHERE user='u1'; SELECT plugin,authentication_string FROM mysql.user WHERE user='u1';
password plugin authentication_string
*2B602296A79E0A8784ACC5C88D92E46588CCA3C3 mysql_native_password *2B602296A79E0A8784ACC5C88D92E46588CCA3C3
CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw2'; CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw2';
Warnings: Warnings:
Note 1973 Can't create user 'u1'@'localhost'; it already exists Note 1973 Can't create user 'u1'@'localhost'; it already exists
SELECT password FROM mysql.user WHERE user='u1'; SELECT plugin,authentication_string FROM mysql.user WHERE user='u1';
password plugin authentication_string
*2B602296A79E0A8784ACC5C88D92E46588CCA3C3 mysql_native_password *2B602296A79E0A8784ACC5C88D92E46588CCA3C3
CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'pw3'; CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'pw3';
SELECT password FROM mysql.user WHERE user='u1'; SELECT plugin,authentication_string FROM mysql.user WHERE user='u1';
password plugin authentication_string
*77B4A70CEFD76DB9415F36D291E74C110D2738E0 mysql_native_password *77B4A70CEFD76DB9415F36D291E74C110D2738E0
CREATE OR REPLACE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw4'; CREATE OR REPLACE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw4';
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
SELECT password FROM mysql.user WHERE user='u1'; SELECT plugin,authentication_string FROM mysql.user WHERE user='u1';
password plugin authentication_string
*77B4A70CEFD76DB9415F36D291E74C110D2738E0 mysql_native_password *77B4A70CEFD76DB9415F36D291E74C110D2738E0
DROP USER IF EXISTS u1@localhost; DROP USER IF EXISTS u1@localhost;
DROP USER IF EXISTS u1@localhost; DROP USER IF EXISTS u1@localhost;
Warnings: Warnings:
......
--source include/not_embedded.inc --source include/not_embedded.inc
CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw1'; CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw1';
SELECT password FROM mysql.user WHERE user='u1'; SELECT plugin,authentication_string FROM mysql.user WHERE user='u1';
CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw2'; CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw2';
SELECT password FROM mysql.user WHERE user='u1'; SELECT plugin,authentication_string FROM mysql.user WHERE user='u1';
CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'pw3'; CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'pw3';
SELECT password FROM mysql.user WHERE user='u1'; SELECT plugin,authentication_string FROM mysql.user WHERE user='u1';
--error ER_WRONG_USAGE --error ER_WRONG_USAGE
CREATE OR REPLACE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw4'; CREATE OR REPLACE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw4';
SELECT password FROM mysql.user WHERE user='u1'; SELECT plugin,authentication_string FROM mysql.user WHERE user='u1';
DROP USER IF EXISTS u1@localhost; DROP USER IF EXISTS u1@localhost;
DROP USER IF EXISTS u1@localhost; DROP USER IF EXISTS u1@localhost;
......
This diff is collapsed.
...@@ -58,7 +58,7 @@ max_questions 0 ...@@ -58,7 +58,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -134,7 +134,7 @@ max_questions 10 ...@@ -134,7 +134,7 @@ max_questions 10
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -186,7 +186,7 @@ max_questions 10 ...@@ -186,7 +186,7 @@ max_questions 10
max_updates 20 max_updates 20
max_connections 30 max_connections 30
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
......
...@@ -181,19 +181,19 @@ grant select on *.* to 'mysqltest_2'; ...@@ -181,19 +181,19 @@ grant select on *.* to 'mysqltest_2';
grant insert on test.* to 'mysqltest_2'; grant insert on test.* to 'mysqltest_2';
grant update on test.t1 to 'mysqltest_2'; grant update on test.t1 to 'mysqltest_2';
grant update (c2) on test.t2 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; select host,user,password,plugin,authentication_string from mysql.user where user like 'mysqltest_%';
host user password host user password plugin authentication_string
% mysqltest_1 % mysqltest_1 mysql_native_password
% mysqltest_2 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 % mysqltest_2 mysql_native_password *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1
% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff % mysqltest_3 mysql_native_password fffffffffffffffffffffffffffffffffffffffff
select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user; select host,db,user from mysql.db where user like 'mysqltest_%';
host db user host db user
% test mysqltest_2 % 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 host db user table_name
% test mysqltest_2 t1 % test mysqltest_2 t1
% test mysqltest_2 t2 % 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 host db user table_name column_name
% test mysqltest_2 t2 c2 % test mysqltest_2 t2 c2
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
...@@ -206,35 +206,35 @@ GRANT INSERT ON "test".* TO 'mysqltest_2'@'%' ...@@ -206,35 +206,35 @@ GRANT INSERT ON "test".* TO 'mysqltest_2'@'%'
GRANT UPDATE (c2) ON "test"."t2" TO 'mysqltest_2'@'%' GRANT UPDATE (c2) ON "test"."t2" TO 'mysqltest_2'@'%'
GRANT UPDATE ON "test"."t1" TO 'mysqltest_2'@'%' GRANT UPDATE ON "test"."t1" TO 'mysqltest_2'@'%'
drop user 'mysqltest_1'; drop user 'mysqltest_1';
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_%';
host user password host user password plugin authentication_string
% mysqltest_2 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 % mysqltest_2 mysql_native_password *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1
% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff % mysqltest_3 mysql_native_password fffffffffffffffffffffffffffffffffffffffff
select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user; select host,db,user from mysql.db where user like 'mysqltest_%';
host db user host db user
% test mysqltest_2 % 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 host db user table_name
% test mysqltest_2 t1 % test mysqltest_2 t1
% test mysqltest_2 t2 % 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 host db user table_name column_name
% test mysqltest_2 t2 c2 % test mysqltest_2 t2 c2
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%' ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%'
rename user 'mysqltest_2' to 'mysqltest_1'; rename user 'mysqltest_2' to 'mysqltest_1';
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_%' ;
host user password host user password plugin authentication_string
% mysqltest_1 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 % mysqltest_1 mysql_native_password *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1
% mysqltest_3 fffffffffffffffffffffffffffffffffffffffff % mysqltest_3 mysql_native_password fffffffffffffffffffffffffffffffffffffffff
select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user; select host,db,user from mysql.db where user like 'mysqltest_%' ;
host db user host db user
% test mysqltest_1 % 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 host db user table_name
% test mysqltest_1 t1 % test mysqltest_1 t1
% test mysqltest_1 t2 % 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 host db user table_name column_name
% test mysqltest_1 t2 c2 % test mysqltest_1 t2 c2
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
...@@ -254,21 +254,21 @@ ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%' ...@@ -254,21 +254,21 @@ ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%'
revoke all privileges, grant option from 'mysqltest_1'; revoke all privileges, grant option from 'mysqltest_1';
ERROR HY000: Can't revoke all privileges for one or more of the requested users ERROR HY000: Can't revoke all privileges for one or more of the requested users
drop user 'mysqltest_1'; 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 host db user
insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1'; insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1';
flush privileges; flush privileges;
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%' ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%'
drop user 'mysqltest_1'; 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 host db user table_name
insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1'; insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1';
flush privileges; flush privileges;
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%' ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%'
drop user 'mysqltest_1'; 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 host db user table_name column_name
create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
...@@ -310,7 +310,7 @@ create user mysqltest_2@localhost; ...@@ -310,7 +310,7 @@ create user mysqltest_2@localhost;
grant create user on *.* to mysqltest_2@localhost; grant create user on *.* to mysqltest_2@localhost;
connect user3,localhost,mysqltest_2,,; connect user3,localhost,mysqltest_2,,;
connection user3; 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' ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 'user'
create user mysqltest_A@'%'; create user mysqltest_A@'%';
rename user mysqltest_A@'%' to mysqltest_B@'%'; rename user mysqltest_A@'%' to mysqltest_B@'%';
...@@ -326,7 +326,7 @@ show grants; ...@@ -326,7 +326,7 @@ show grants;
Grants for mysqltest_3@localhost Grants for mysqltest_3@localhost
GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
GRANT INSERT, UPDATE, DELETE ON `mysql`.* 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' ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 'user'
insert into mysql.user set host='%', user='mysqltest_B'; insert into mysql.user set host='%', user='mysqltest_B';
Warnings: Warnings:
...@@ -555,28 +555,25 @@ End of 5.0 tests ...@@ -555,28 +555,25 @@ End of 5.0 tests
USE mysql; USE mysql;
SELECT LEFT(CURRENT_USER(),INSTR(CURRENT_USER(),'@')-1) INTO @u; SELECT LEFT(CURRENT_USER(),INSTR(CURRENT_USER(),'@')-1) INTO @u;
SELECT MID(CURRENT_USER(),INSTR(CURRENT_USER(),'@')+1) INTO @h; 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,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h;
Warnings: user host password plugin authentication_string insert_priv
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 user,host,password,insert_priv FROM user WHERE user=@u AND host=@h;
user host password insert_priv
root localhost Y root localhost Y
UPDATE user SET insert_priv='N' WHERE user=@u AND host=@h; 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; SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h;
user host password insert_priv user host password plugin authentication_string insert_priv
root localhost N root localhost N
GRANT INSERT ON *.* TO CURRENT_USER(); GRANT INSERT ON *.* TO CURRENT_USER();
SELECT user,host,password,insert_priv FROM user 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 insert_priv user host password plugin authentication_string insert_priv
root localhost Y root localhost Y
UPDATE user SET insert_priv='N' WHERE user=@u AND host=@h; UPDATE user SET insert_priv='N' WHERE user=@u AND host=@h;
GRANT INSERT ON *.* TO CURRENT_USER() IDENTIFIED BY 'keksdose'; GRANT INSERT ON *.* TO CURRENT_USER() IDENTIFIED BY 'keksdose';
SELECT user,host,password,insert_priv FROM user 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 insert_priv user host password plugin authentication_string insert_priv
root localhost *0BB7188CF0DE9B403BA66E9DD810D82652D002EB Y root localhost mysql_native_password *0BB7188CF0DE9B403BA66E9DD810D82652D002EB Y
UPDATE user SET password=@pwd WHERE user=@u AND host=@h; UPDATE user SET plugin='', authentication_string='' WHERE user=@u AND host=@h;
SELECT user,host,password,insert_priv FROM user 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 insert_priv user host password plugin authentication_string insert_priv
root localhost Y root localhost Y
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
USE test; USE test;
......
...@@ -231,28 +231,40 @@ grant select on *.* to 'mysqltest_2'; ...@@ -231,28 +231,40 @@ grant select on *.* to 'mysqltest_2';
grant insert on test.* to 'mysqltest_2'; grant insert on test.* to 'mysqltest_2';
grant update on test.t1 to 'mysqltest_2'; grant update on test.t1 to 'mysqltest_2';
grant update (c2) on test.t2 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; --sorted_result
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_%';
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name; --sorted_result
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 from mysql.db where user like 'mysqltest_%';
--sorted_result
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%';
--sorted_result
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%';
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
show grants for 'mysqltest_2'; show grants for 'mysqltest_2';
# #
# Drop # Drop
drop user 'mysqltest_1'; drop user 'mysqltest_1';
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; --sorted_result
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_%';
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name; --sorted_result
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 from mysql.db where user like 'mysqltest_%';
--sorted_result
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%';
--sorted_result
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%';
--error ER_NONEXISTING_GRANT --error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
# #
# Rename # Rename
rename user 'mysqltest_2' to 'mysqltest_1'; rename user 'mysqltest_2' to 'mysqltest_1';
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; --sorted_result
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_%' ;
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name; --sorted_result
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 from mysql.db where user like 'mysqltest_%' ;
--sorted_result
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' ;
--sorted_result
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' ;
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
drop user 'mysqltest_1', 'mysqltest_3'; drop user 'mysqltest_1', 'mysqltest_3';
--error ER_CANNOT_USER --error ER_CANNOT_USER
...@@ -269,7 +281,8 @@ show grants for 'mysqltest_1'; ...@@ -269,7 +281,8 @@ show grants for 'mysqltest_1';
--error ER_REVOKE_GRANTS --error ER_REVOKE_GRANTS
revoke all privileges, grant option from 'mysqltest_1'; revoke all privileges, grant option from 'mysqltest_1';
drop user 'mysqltest_1'; drop user 'mysqltest_1';
select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,user; --sorted_result
select host,db,user from mysql.db where user = 'mysqltest_1' ;
# #
# Add a stray record # Add a stray record
insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1'; insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1';
...@@ -277,7 +290,8 @@ flush privileges; ...@@ -277,7 +290,8 @@ flush privileges;
--error ER_NONEXISTING_GRANT --error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
drop user 'mysqltest_1'; 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; --sorted_result
select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' ;
# #
# Add a stray record # Add a stray record
insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1'; insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1';
...@@ -285,7 +299,8 @@ flush privileges; ...@@ -285,7 +299,8 @@ flush privileges;
--error ER_NONEXISTING_GRANT --error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1'; show grants for 'mysqltest_1';
drop user 'mysqltest_1'; 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; --sorted_result
select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' ;
# #
# Handle multi user lists # Handle multi user lists
create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
...@@ -330,7 +345,7 @@ grant create user on *.* to mysqltest_2@localhost; ...@@ -330,7 +345,7 @@ grant create user on *.* to mysqltest_2@localhost;
connect (user3,localhost,mysqltest_2,,); connect (user3,localhost,mysqltest_2,,);
connection user3; connection user3;
--error ER_TABLEACCESS_DENIED_ERROR --error ER_TABLEACCESS_DENIED_ERROR
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_%' ;
create user mysqltest_A@'%'; create user mysqltest_A@'%';
rename user mysqltest_A@'%' to mysqltest_B@'%'; rename user mysqltest_A@'%' to mysqltest_B@'%';
drop user mysqltest_B@'%'; drop user mysqltest_B@'%';
...@@ -345,7 +360,7 @@ connect (user4,localhost,mysqltest_3,,); ...@@ -345,7 +360,7 @@ connect (user4,localhost,mysqltest_3,,);
connection user4; connection user4;
show grants; show grants;
--error ER_TABLEACCESS_DENIED_ERROR --error ER_TABLEACCESS_DENIED_ERROR
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_%' ;
insert into mysql.user set host='%', user='mysqltest_B'; insert into mysql.user set host='%', user='mysqltest_B';
create user mysqltest_A@'%'; create user mysqltest_A@'%';
rename user mysqltest_B@'%' to mysqltest_C@'%'; rename user mysqltest_B@'%' to mysqltest_C@'%';
...@@ -642,26 +657,25 @@ DROP DATABASE db1; ...@@ -642,26 +657,25 @@ DROP DATABASE db1;
USE mysql; USE mysql;
SELECT LEFT(CURRENT_USER(),INSTR(CURRENT_USER(),'@')-1) INTO @u; SELECT LEFT(CURRENT_USER(),INSTR(CURRENT_USER(),'@')-1) INTO @u;
SELECT MID(CURRENT_USER(),INSTR(CURRENT_USER(),'@')+1) INTO @h; SELECT MID(CURRENT_USER(),INSTR(CURRENT_USER(),'@')+1) INTO @h;
SELECT password FROM user WHERE user=@u AND host=@h INTO @pwd;
# show current privs. # show current privs.
SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h;
# toggle INSERT # toggle INSERT
UPDATE user SET insert_priv='N' WHERE user=@u AND host=@h; 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; SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h;
# show that GRANT ... TO CURRENT_USER() no longer crashes # show that GRANT ... TO CURRENT_USER() no longer crashes
GRANT INSERT ON *.* TO CURRENT_USER(); GRANT INSERT ON *.* TO CURRENT_USER();
SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h;
UPDATE user SET insert_priv='N' WHERE user=@u AND host=@h; UPDATE user SET insert_priv='N' WHERE user=@u AND host=@h;
# show that GRANT ... TO CURRENT_USER() IDENTIFIED BY ... works now # show that GRANT ... TO CURRENT_USER() IDENTIFIED BY ... works now
GRANT INSERT ON *.* TO CURRENT_USER() IDENTIFIED BY 'keksdose'; GRANT INSERT ON *.* TO CURRENT_USER() IDENTIFIED BY 'keksdose';
SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h;
UPDATE user SET password=@pwd WHERE user=@u AND host=@h; UPDATE user SET plugin='', authentication_string='' WHERE user=@u AND host=@h;
SELECT user,host,password,insert_priv FROM user WHERE user=@u AND host=@h; SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h;
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
......
...@@ -199,14 +199,14 @@ grant select on test.* to foo7 identified via mysql_native_password using '11111 ...@@ -199,14 +199,14 @@ grant select on test.* to foo7 identified via mysql_native_password using '11111
grant select on test.* to foo8 identified via mysql_old_password using '2222222222222222'; grant select on test.* to foo8 identified via mysql_old_password using '2222222222222222';
select user,password,plugin,authentication_string from mysql.user where user like 'foo%'; select user,password,plugin,authentication_string from mysql.user where user like 'foo%';
user password plugin authentication_string user password plugin authentication_string
foo1 11111111111111111111111111111111111111111 foo1 mysql_native_password 11111111111111111111111111111111111111111
foo2 2222222222222222 foo2 mysql_old_password 2222222222222222
foo3 11111111111111111111111111111111111111111 foo3 mysql_native_password 11111111111111111111111111111111111111111
foo4 2222222222222222 foo4 mysql_old_password 2222222222222222
foo5 11111111111111111111111111111111111111111 foo5 mysql_native_password 11111111111111111111111111111111111111111
foo6 2222222222222222 foo6 mysql_old_password 2222222222222222
foo7 11111111111111111111111111111111111111111 foo7 mysql_native_password 11111111111111111111111111111111111111111
foo8 2222222222222222 foo8 mysql_old_password 2222222222222222
drop user foo1; drop user foo1;
drop user foo2; drop user foo2;
drop user foo3; drop user foo3;
......
...@@ -2,7 +2,7 @@ create user foo@localhost; ...@@ -2,7 +2,7 @@ create user foo@localhost;
select user,host,password from mysql.user where user='foo'; select user,host,password from mysql.user where user='foo';
user host password user host password
foo localhost foo localhost
select user,host,password from mysql.user where user='foo'; select user,host,password,plugin,authentication_string from mysql.user where user='foo';
user host password user host password plugin authentication_string
foo localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 foo localhost mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
drop user foo@localhost; drop user foo@localhost;
...@@ -21,6 +21,6 @@ EOF ...@@ -21,6 +21,6 @@ EOF
--exec echo "restart:--init-file=$MYSQLTEST_VARDIR/init.file " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --exec echo "restart:--init-file=$MYSQLTEST_VARDIR/init.file " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
select user,host,password from mysql.user where user='foo'; select user,host,password,plugin,authentication_string from mysql.user where user='foo';
drop user foo@localhost; drop user foo@localhost;
...@@ -87,7 +87,7 @@ select user, host, select_priv, plugin, authentication_string from mysql.user ...@@ -87,7 +87,7 @@ select user, host, select_priv, plugin, authentication_string from mysql.user
where user like "%oo" where user like "%oo"
order by user; order by user;
user host select_priv plugin authentication_string user host select_priv plugin authentication_string
foo % N foo % N mysql_native_password
goo % N mysql_native_password *F3A2A51A9B0F2BE2468926B4132313728C250DBF goo % N mysql_native_password *F3A2A51A9B0F2BE2468926B4132313728C250DBF
ioo % N mysql_old_password 7a8f886d28473e85 ioo % N mysql_old_password 7a8f886d28473e85
# #
......
...@@ -106,7 +106,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; ...@@ -106,7 +106,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug, plug_dest; DROP USER plug, plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
...@@ -116,7 +116,7 @@ DROP USER plug; ...@@ -116,7 +116,7 @@ DROP USER plug;
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug_dest; DROP USER plug_dest;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
...@@ -126,7 +126,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; ...@@ -126,7 +126,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug, plug_dest; DROP USER plug, plug_dest;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
...@@ -136,7 +136,7 @@ DROP USER plug; ...@@ -136,7 +136,7 @@ DROP USER plug;
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug_dest; DROP USER plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
...@@ -146,7 +146,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas ...@@ -146,7 +146,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug, plug_dest; DROP USER plug, plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
...@@ -156,7 +156,7 @@ DROP USER plug; ...@@ -156,7 +156,7 @@ DROP USER plug;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug_dest; DROP USER plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
...@@ -175,7 +175,7 @@ plug test_plugin_server plug_dest ...@@ -175,7 +175,7 @@ plug test_plugin_server plug_dest
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
user plugin authentication_string password user plugin authentication_string password
plug *939AEE68989794C0F408277411C26055CDF41119 plug mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug; DROP USER plug;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
CREATE USER plug IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plug IDENTIFIED BY 'plug_dest_passwd';
...@@ -209,7 +209,7 @@ DROP USER plüg; ...@@ -209,7 +209,7 @@ DROP USER plüg;
CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plüg_dest plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plüg_dest; DROP USER plüg_dest;
SET NAMES ascii; SET NAMES ascii;
CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
...@@ -220,7 +220,7 @@ DROP USER 'plüg'; ...@@ -220,7 +220,7 @@ DROP USER 'plüg';
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
pl??g_dest pl??g_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER 'plüg_dest'; DROP USER 'plüg_dest';
SET NAMES latin1; SET NAMES latin1;
========== test 1.1.1.5 ==================================== ========== test 1.1.1.5 ====================================
...@@ -234,7 +234,7 @@ DROP USER 'plug'; ...@@ -234,7 +234,7 @@ DROP USER 'plug';
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plüg_dest plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER 'plüg_dest'; DROP USER 'plüg_dest';
SET NAMES utf8; SET NAMES utf8;
CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest';
...@@ -247,7 +247,7 @@ DROP USER 'plüg'; ...@@ -247,7 +247,7 @@ DROP USER 'plüg';
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plüg_dest plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER 'plüg_dest'; DROP USER 'plüg_dest';
CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest'; CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
...@@ -257,7 +257,7 @@ DROP USER plüg; ...@@ -257,7 +257,7 @@ DROP USER plüg;
CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plüg_dest plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plüg_dest; DROP USER plüg_dest;
========== test 1.1.1.2/1.1.2.2============================= ========== test 1.1.1.2/1.1.2.2=============================
SET @auth_name= 'test_plugin_server'; SET @auth_name= 'test_plugin_server';
...@@ -277,7 +277,7 @@ DROP USER plug; ...@@ -277,7 +277,7 @@ DROP USER plug;
CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
hh's_plug_dest hh's_plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER 'hh''s_plug_dest'; DROP USER 'hh''s_plug_dest';
========== test 1.1.1.4 ==================================== ========== test 1.1.1.4 ====================================
CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest';
...@@ -293,7 +293,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; ...@@ -293,7 +293,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
plug_dest plug_dest mysql_native_password
DROP USER grant_user,plug_dest; DROP USER grant_user,plug_dest;
set @save_sql_mode= @@sql_mode; set @save_sql_mode= @@sql_mode;
SET @@sql_mode=no_auto_create_user; SET @@sql_mode=no_auto_create_user;
...@@ -314,13 +314,13 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; ...@@ -314,13 +314,13 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
user plugin authentication_string password user plugin authentication_string password
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
plug_dest *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug_dest; DROP USER plug_dest;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
user plugin authentication_string password user plugin authentication_string password
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
plug_dest *560881EB651416CEF77314D07D55EDCD5FC1BD6D plug_dest mysql_native_password *560881EB651416CEF77314D07D55EDCD5FC1BD6D
DROP USER grant_user,plug_dest; DROP USER grant_user,plug_dest;
set @@sql_mode= @save_sql_mode; set @@sql_mode= @save_sql_mode;
DROP DATABASE test_user_db; DROP DATABASE test_user_db;
...@@ -20,7 +20,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas ...@@ -20,7 +20,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas
GRANT PROXY ON plug_dest TO plug_user; GRANT PROXY ON plug_dest TO plug_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
1) 1)
current_user() current_user()
...@@ -71,7 +71,7 @@ GRANT PROXY ON new_dest TO plug_user; ...@@ -71,7 +71,7 @@ GRANT PROXY ON new_dest TO plug_user;
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
new_dest new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
DROP USER plug_user,new_dest; DROP USER plug_user,new_dest;
CREATE USER plug_user CREATE USER plug_user
...@@ -89,7 +89,7 @@ GRANT PROXY ON new_dest TO plug_user; ...@@ -89,7 +89,7 @@ GRANT PROXY ON new_dest TO plug_user;
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
new_dest new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
DROP USER plug_user,new_dest; DROP USER plug_user,new_dest;
CREATE USER plug_user CREATE USER plug_user
...@@ -111,13 +111,13 @@ connection default; ...@@ -111,13 +111,13 @@ connection default;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
new_user test_plugin_server plug_dest new_user test_plugin_server plug_dest
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
disconnect plug_user; disconnect plug_user;
UPDATE mysql.user SET user='plug_user' WHERE user='new_user'; UPDATE mysql.user SET user='plug_user' WHERE user='new_user';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
DROP USER plug_dest,plug_user; DROP USER plug_dest,plug_user;
========== test 1.3 ======================================== ========== test 1.3 ========================================
...@@ -133,26 +133,26 @@ connection default; ...@@ -133,26 +133,26 @@ connection default;
disconnect plug_user; disconnect plug_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
UPDATE mysql.user SET user='new_user' WHERE user='plug_user'; UPDATE mysql.user SET user='new_user' WHERE user='plug_user';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
new_user test_plugin_server plug_dest new_user test_plugin_server plug_dest
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user'; UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
new_user test_plugin_server new_dest new_user test_plugin_server new_dest
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user'; UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
new_user new_plugin_server new_dest new_user new_plugin_server new_dest
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
ERROR HY000: Plugin 'new_plugin_server' is not loaded ERROR HY000: Plugin 'new_plugin_server' is not loaded
UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user'; UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user';
UPDATE mysql.user SET USER='new_dest' WHERE user='plug_dest'; UPDATE mysql.user SET USER='new_dest' WHERE user='plug_dest';
...@@ -160,7 +160,7 @@ FLUSH PRIVILEGES; ...@@ -160,7 +160,7 @@ FLUSH PRIVILEGES;
GRANT PROXY ON new_dest TO new_user; GRANT PROXY ON new_dest TO new_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
new_dest new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
new_user test_plugin_server new_dest new_user test_plugin_server new_dest
connect plug_user,localhost,new_user,new_dest; connect plug_user,localhost,new_user,new_dest;
select USER(),CURRENT_USER(); select USER(),CURRENT_USER();
...@@ -173,9 +173,9 @@ FLUSH PRIVILEGES; ...@@ -173,9 +173,9 @@ FLUSH PRIVILEGES;
CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd'; CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
new_dest new_dest mysql_native_password *01422E86A6FFF84618914AF149F9AEF64B84170A
new_user test_plugin_server new_dest new_user test_plugin_server new_dest
plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
GRANT ALL PRIVILEGES ON test.* TO new_user; GRANT ALL PRIVILEGES ON test.* TO new_user;
connect plug_user,localhost,new_dest,new_dest_passwd; connect plug_user,localhost,new_dest,new_dest_passwd;
select USER(),CURRENT_USER(); select USER(),CURRENT_USER();
...@@ -190,7 +190,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; ...@@ -190,7 +190,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
test_plugin_server proxied_user test_plugin_server proxied_user
proxied_user proxied_user mysql_native_password *D7A51428CD38DB3C5293B9321DA1228BFB1611DD
connect proxy_con,localhost,proxied_user,proxied_user_passwd; connect proxy_con,localhost,proxied_user,proxied_user_passwd;
SELECT USER(),CURRENT_USER(); SELECT USER(),CURRENT_USER();
USER() CURRENT_USER() USER() CURRENT_USER()
...@@ -226,7 +226,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; ...@@ -226,7 +226,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
test_plugin_server proxied_user test_plugin_server proxied_user
proxied_user proxied_user mysql_native_password *D7A51428CD38DB3C5293B9321DA1228BFB1611DD
connect proxy_con,localhost,proxied_user,proxied_user_passwd; connect proxy_con,localhost,proxied_user,proxied_user_passwd;
SELECT USER(),CURRENT_USER(); SELECT USER(),CURRENT_USER();
USER() CURRENT_USER() USER() CURRENT_USER()
...@@ -268,11 +268,11 @@ GRANT PROXY ON proxied_user_5 TO ''@'%%'; ...@@ -268,11 +268,11 @@ GRANT PROXY ON proxied_user_5 TO ''@'%%';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
test_plugin_server proxied_user test_plugin_server proxied_user
proxied_user_1 proxied_user_1 mysql_native_password *551D5A5177FCC3340F7D2FB0F4D8D1EEA7F7EF71
proxied_user_2 proxied_user_2 mysql_native_password *3D948F77C6A988AFDCA9755AB2A6724362557220
proxied_user_3 proxied_user_3 mysql_native_password *41A18925D237DEE738C76581153990B037F462E3
proxied_user_4 proxied_user_4 mysql_native_password *F990073A9B96FF535C2D0721406042B8751E593F
proxied_user_5 proxied_user_5 mysql_native_password *5AA915C5D0B5B1336336FD2BF7768BC09FD1F5B2
connect proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd'; connect proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd';
connect proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd; connect proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd;
connect proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd; connect proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd;
......
...@@ -7,7 +7,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_pas ...@@ -7,7 +7,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_pas
GRANT PROXY ON qa_test_1_dest TO qa_test_1_user; GRANT PROXY ON qa_test_1_dest TO qa_test_1_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
qa_test_1_dest qa_test_1_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_1_user qa_auth_interface qa_test_1_dest qa_test_1_user qa_auth_interface qa_test_1_dest
SELECT @@proxy_user; SELECT @@proxy_user;
@@proxy_user @@proxy_user
...@@ -20,7 +20,7 @@ current_user() user() @@local.proxy_user @@local.external_user ...@@ -20,7 +20,7 @@ current_user() user() @@local.proxy_user @@local.external_user
qa_test_1_user@% qa_test_1_user@localhost NULL NULL qa_test_1_user@% qa_test_1_user@localhost NULL NULL
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
qa_test_1_dest qa_test_1_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_1_user qa_auth_interface qa_test_1_dest qa_test_1_user qa_auth_interface qa_test_1_dest
DROP USER qa_test_1_user; DROP USER qa_test_1_user;
DROP USER qa_test_1_dest; DROP USER qa_test_1_dest;
...@@ -33,8 +33,8 @@ GRANT PROXY ON qa_test_2_dest TO qa_test_2_user; ...@@ -33,8 +33,8 @@ GRANT PROXY ON qa_test_2_dest TO qa_test_2_user;
GRANT PROXY ON authenticated_as TO qa_test_2_user; GRANT PROXY ON authenticated_as TO qa_test_2_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
authenticated_as authenticated_as mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_2_dest qa_test_2_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_2_user qa_auth_interface qa_test_2_dest qa_test_2_user qa_auth_interface qa_test_2_dest
SELECT @@proxy_user; SELECT @@proxy_user;
@@proxy_user @@proxy_user
...@@ -47,8 +47,8 @@ current_user() user() @@local.proxy_user @@local.external_user ...@@ -47,8 +47,8 @@ current_user() user() @@local.proxy_user @@local.external_user
authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' externaluser authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' externaluser
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
authenticated_as authenticated_as mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_2_dest qa_test_2_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_2_user qa_auth_interface qa_test_2_dest qa_test_2_user qa_auth_interface qa_test_2_dest
DROP USER qa_test_2_user; DROP USER qa_test_2_user;
DROP USER qa_test_2_dest; DROP USER qa_test_2_dest;
...@@ -83,8 +83,8 @@ GRANT PROXY ON qa_test_5_dest TO qa_test_5_user; ...@@ -83,8 +83,8 @@ GRANT PROXY ON qa_test_5_dest TO qa_test_5_user;
GRANT PROXY ON qa_test_5_dest TO ''@'localhost'; GRANT PROXY ON qa_test_5_dest TO ''@'localhost';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
user plugin authentication_string password user plugin authentication_string password
*DFCACE76914AD7BD801FC1A1ECF6562272621A22 mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_5_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_5_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_5_user qa_auth_interface qa_test_5_dest qa_test_5_user qa_auth_interface qa_test_5_dest
exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
ERROR 1045 (28000): Access denied for user 'qa_test_5_user'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied for user 'qa_test_5_user'@'localhost' (using password: YES)
...@@ -98,21 +98,21 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_pas ...@@ -98,21 +98,21 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_pas
GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; GRANT PROXY ON qa_test_6_dest TO qa_test_6_user;
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
user plugin authentication_string password user plugin authentication_string password
qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_6_user qa_auth_interface qa_test_6_dest qa_test_6_user qa_auth_interface qa_test_6_dest
exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using password: YES)
GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
user plugin authentication_string password user plugin authentication_string password
qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_6_user qa_auth_interface qa_test_6_dest qa_test_6_user qa_auth_interface qa_test_6_dest
exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
REVOKE PROXY ON qa_test_6_dest FROM root; REVOKE PROXY ON qa_test_6_dest FROM root;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
qa_test_6_dest qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_6_user qa_auth_interface qa_test_6_dest qa_test_6_user qa_auth_interface qa_test_6_dest
exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
......
...@@ -9,11 +9,11 @@ create user oldpassold@localhost identified with 'mysql_old_password'; ...@@ -9,11 +9,11 @@ create user oldpassold@localhost identified with 'mysql_old_password';
set password for oldpassold@localhost = '378b243e220ca493'; set password for oldpassold@localhost = '378b243e220ca493';
select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
user host password plugin authentication_string user host password plugin authentication_string
natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 natauth localhost mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 newpass localhost mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
newpassnat localhost mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 newpassnat localhost mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
oldauth localhost 378b243e220ca493 oldauth localhost mysql_old_password 378b243e220ca493
oldpass localhost 378b243e220ca493 oldpass localhost mysql_old_password 378b243e220ca493
oldpassold localhost mysql_old_password 378b243e220ca493 oldpassold localhost mysql_old_password 378b243e220ca493
connect con,localhost,natauth,test,; connect con,localhost,natauth,test,;
select current_user(); select current_user();
......
...@@ -7,7 +7,7 @@ create user u1; ...@@ -7,7 +7,7 @@ create user u1;
GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password; GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password;
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string user host password plugin authentication_string
u1 % u1 % mysql_native_password
# #
# The user's grants should show no password at all. # The user's grants should show no password at all.
# #
...@@ -43,7 +43,7 @@ GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password ...@@ -43,7 +43,7 @@ GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password
USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626'; USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626';
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string user host password plugin authentication_string
u1 % *7AFEFD08B6B720E781FB000CAA418F54FA662626 u1 % mysql_native_password *7AFEFD08B6B720E781FB000CAA418F54FA662626
# #
# Test to see if connecting with password is succesful. # Test to see if connecting with password is succesful.
# #
......
...@@ -506,9 +506,9 @@ DROP DATABASE mysqltest; ...@@ -506,9 +506,9 @@ DROP DATABASE mysqltest;
GRANT USAGE ON *.* TO user19857@localhost IDENTIFIED BY 'meow'; GRANT USAGE ON *.* TO user19857@localhost IDENTIFIED BY 'meow';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE ROUTINE, ALTER ROUTINE ON test.* TO GRANT SELECT, INSERT, UPDATE, DELETE, CREATE ROUTINE, ALTER ROUTINE ON test.* TO
user19857@localhost; user19857@localhost;
SELECT Host,User,Password FROM mysql.user WHERE User='user19857'; SELECT Host,User,Plugin,Authentication_string FROM mysql.user WHERE User='user19857';
Host User Password Host User Plugin Authentication_string
localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C localhost user19857 mysql_native_password *82DC221D557298F6CE9961037DB1C90604792F5C
connect mysqltest_2_con,localhost,user19857,meow,test; connect mysqltest_2_con,localhost,user19857,meow,test;
connection mysqltest_2_con; connection mysqltest_2_con;
USE test; USE test;
...@@ -533,9 +533,9 @@ connection mysqltest_2_con; ...@@ -533,9 +533,9 @@ connection mysqltest_2_con;
DROP PROCEDURE IF EXISTS test.sp19857; DROP PROCEDURE IF EXISTS test.sp19857;
connection con1root; connection con1root;
disconnect mysqltest_2_con; disconnect mysqltest_2_con;
SELECT Host,User,Password FROM mysql.user WHERE User='user19857'; SELECT Host,User,Plugin,Authentication_string FROM mysql.user WHERE User='user19857';
Host User Password Host User Plugin Authentication_string
localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C localhost user19857 mysql_native_password *82DC221D557298F6CE9961037DB1C90604792F5C
DROP USER user19857@localhost; DROP USER user19857@localhost;
disconnect con1root; disconnect con1root;
connection default; connection default;
......
...@@ -742,7 +742,7 @@ DROP DATABASE mysqltest; ...@@ -742,7 +742,7 @@ DROP DATABASE mysqltest;
GRANT USAGE ON *.* TO user19857@localhost IDENTIFIED BY 'meow'; GRANT USAGE ON *.* TO user19857@localhost IDENTIFIED BY 'meow';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE ROUTINE, ALTER ROUTINE ON test.* TO GRANT SELECT, INSERT, UPDATE, DELETE, CREATE ROUTINE, ALTER ROUTINE ON test.* TO
user19857@localhost; user19857@localhost;
SELECT Host,User,Password FROM mysql.user WHERE User='user19857'; SELECT Host,User,Plugin,Authentication_string FROM mysql.user WHERE User='user19857';
--connect (mysqltest_2_con,localhost,user19857,meow,test) --connect (mysqltest_2_con,localhost,user19857,meow,test)
--connection mysqltest_2_con --connection mysqltest_2_con
...@@ -770,7 +770,7 @@ DROP PROCEDURE IF EXISTS test.sp19857; ...@@ -770,7 +770,7 @@ DROP PROCEDURE IF EXISTS test.sp19857;
--disconnect mysqltest_2_con --disconnect mysqltest_2_con
SELECT Host,User,Password FROM mysql.user WHERE User='user19857'; SELECT Host,User,Plugin,Authentication_string FROM mysql.user WHERE User='user19857';
DROP USER user19857@localhost; DROP USER user19857@localhost;
......
...@@ -324,7 +324,7 @@ DROP EVENT teste_bug11763507; ...@@ -324,7 +324,7 @@ DROP EVENT teste_bug11763507;
# -- End of 5.1 tests # -- End of 5.1 tests
# ------------------------------------------------------------------ # ------------------------------------------------------------------
grant create routine on test.* to foo1@localhost identified by 'foo'; grant create routine on test.* to foo1@localhost identified by 'foo';
update mysql.user set password = replace(password, '*', '-') where user='foo1'; update mysql.user set authentication_string = replace(authentication_string, '*', '-') where user='foo1';
connect foo,localhost,foo1,foo; connect foo,localhost,foo1,foo;
show grants; show grants;
Grants for foo1@localhost Grants for foo1@localhost
......
...@@ -465,7 +465,7 @@ DROP EVENT teste_bug11763507; ...@@ -465,7 +465,7 @@ DROP EVENT teste_bug11763507;
# (creating a new procedure changes the password) # (creating a new procedure changes the password)
# #
grant create routine on test.* to foo1@localhost identified by 'foo'; grant create routine on test.* to foo1@localhost identified by 'foo';
update mysql.user set password = replace(password, '*', '-') where user='foo1'; update mysql.user set authentication_string = replace(authentication_string, '*', '-') where user='foo1';
--connect (foo,localhost,foo1,foo) --connect (foo,localhost,foo1,foo)
show grants; show grants;
--connection default --connection default
......
...@@ -128,7 +128,7 @@ max_questions 0 ...@@ -128,7 +128,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -175,7 +175,7 @@ max_questions 0 ...@@ -175,7 +175,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -222,7 +222,7 @@ max_questions 0 ...@@ -222,7 +222,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -293,7 +293,7 @@ max_questions 0 ...@@ -293,7 +293,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -340,7 +340,7 @@ max_questions 0 ...@@ -340,7 +340,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -387,7 +387,7 @@ max_questions 0 ...@@ -387,7 +387,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -444,7 +444,7 @@ max_questions 0 ...@@ -444,7 +444,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -491,7 +491,7 @@ max_questions 0 ...@@ -491,7 +491,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -538,7 +538,7 @@ max_questions 0 ...@@ -538,7 +538,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -617,7 +617,7 @@ max_questions 0 ...@@ -617,7 +617,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -664,7 +664,7 @@ max_questions 0 ...@@ -664,7 +664,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -711,7 +711,7 @@ max_questions 0 ...@@ -711,7 +711,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -782,7 +782,7 @@ max_questions 0 ...@@ -782,7 +782,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -829,7 +829,7 @@ max_questions 0 ...@@ -829,7 +829,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -876,7 +876,7 @@ max_questions 0 ...@@ -876,7 +876,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -933,7 +933,7 @@ max_questions 0 ...@@ -933,7 +933,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -980,7 +980,7 @@ max_questions 0 ...@@ -980,7 +980,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1027,7 +1027,7 @@ max_questions 0 ...@@ -1027,7 +1027,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1136,7 +1136,7 @@ max_questions 0 ...@@ -1136,7 +1136,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1183,7 +1183,7 @@ max_questions 0 ...@@ -1183,7 +1183,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1230,7 +1230,7 @@ max_questions 0 ...@@ -1230,7 +1230,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1334,7 +1334,7 @@ max_questions 0 ...@@ -1334,7 +1334,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1381,7 +1381,7 @@ max_questions 0 ...@@ -1381,7 +1381,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1428,7 +1428,7 @@ max_questions 0 ...@@ -1428,7 +1428,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1485,7 +1485,7 @@ max_questions 0 ...@@ -1485,7 +1485,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1532,7 +1532,7 @@ max_questions 0 ...@@ -1532,7 +1532,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1579,7 +1579,7 @@ max_questions 0 ...@@ -1579,7 +1579,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1643,7 +1643,7 @@ max_questions 0 ...@@ -1643,7 +1643,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1690,7 +1690,7 @@ max_questions 0 ...@@ -1690,7 +1690,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1737,7 +1737,7 @@ max_questions 0 ...@@ -1737,7 +1737,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1816,7 +1816,7 @@ max_questions 0 ...@@ -1816,7 +1816,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1863,7 +1863,7 @@ max_questions 0 ...@@ -1863,7 +1863,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
...@@ -1910,7 +1910,7 @@ max_questions 0 ...@@ -1910,7 +1910,7 @@ max_questions 0
max_updates 0 max_updates 0
max_connections 0 max_connections 0
max_user_connections 0 max_user_connections 0
plugin plugin mysql_native_password
authentication_string authentication_string
password_expired N password_expired N
is_role N is_role N
......
...@@ -135,8 +135,10 @@ grant select on *.* to foo2 identified with mysql_old_password using '2222222222 ...@@ -135,8 +135,10 @@ grant select on *.* to foo2 identified with mysql_old_password using '2222222222
ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
create user foo2 identified with mysql_native_password using ''; create user foo2 identified with mysql_native_password using '';
ERROR HY000: Your password does not satisfy the current policy requirements ERROR HY000: Your password does not satisfy the current policy requirements
grant select on *.* to foo2 identified with mysql_old_password using '';
ERROR HY000: Your password does not satisfy the current policy requirements
grant select on *.* to foo2 identified with mysql_old_password; grant select on *.* to foo2 identified with mysql_old_password;
ERROR 28000: Can't find any matching row in the user table ERROR HY000: Your password does not satisfy the current policy requirements
update mysql.user set password='xxx' where user='foo1'; update mysql.user set password='xxx' where user='foo1';
set global strict_password_validation=0; set global strict_password_validation=0;
set password for foo1 = ''; set password for foo1 = '';
......
...@@ -83,7 +83,9 @@ create user foo2 identified with mysql_native_password using '111111111111111111 ...@@ -83,7 +83,9 @@ create user foo2 identified with mysql_native_password using '111111111111111111
grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222'; grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
--error ER_NOT_VALID_PASSWORD --error ER_NOT_VALID_PASSWORD
create user foo2 identified with mysql_native_password using ''; create user foo2 identified with mysql_native_password using '';
--error ER_PASSWORD_NO_MATCH --error ER_NOT_VALID_PASSWORD
grant select on *.* to foo2 identified with mysql_old_password using '';
--error ER_NOT_VALID_PASSWORD
grant select on *.* to foo2 identified with mysql_old_password; grant select on *.* to foo2 identified with mysql_old_password;
# direct updates are not protected # direct updates are not protected
......
...@@ -17,15 +17,15 @@ CURRENT_USER ...@@ -17,15 +17,15 @@ CURRENT_USER
u2@localhost u2@localhost
disconnect user_a; disconnect user_a;
connection master; connection master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
user password user password plugin authentication_string
u1 *D9553C4CE316A9845CE49E30A2D7E3857AF966C4 u1 mysql_native_password *D9553C4CE316A9845CE49E30A2D7E3857AF966C4
u2 u2 mysql_native_password
connection slave; connection slave;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
user password user password plugin authentication_string
u1 *D9553C4CE316A9845CE49E30A2D7E3857AF966C4 u1 mysql_native_password *D9553C4CE316A9845CE49E30A2D7E3857AF966C4
u2 u2 mysql_native_password
connection master; connection master;
CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'abcdefghijk2'; CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'abcdefghijk2';
connect user_a, localhost, u1,'abcdefghijk2',; connect user_a, localhost, u1,'abcdefghijk2',;
...@@ -35,25 +35,25 @@ CURRENT_USER ...@@ -35,25 +35,25 @@ CURRENT_USER
u1@localhost u1@localhost
disconnect user_a; disconnect user_a;
connection master; connection master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
user password user password plugin authentication_string
u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E u1 mysql_native_password *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
u2 u2 mysql_native_password
connection slave; connection slave;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
user password user password plugin authentication_string
u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E u1 mysql_native_password *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
u2 u2 mysql_native_password
connection master; connection master;
CREATE USER u1@localhost; CREATE USER u1@localhost;
ERROR HY000: Operation CREATE USER failed for 'u1'@'localhost' ERROR HY000: Operation CREATE USER failed for 'u1'@'localhost'
DROP USER u3@localhost; DROP USER u3@localhost;
ERROR HY000: Operation DROP USER failed for 'u3'@'localhost' ERROR HY000: Operation DROP USER failed for 'u3'@'localhost'
connection slave; connection slave;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
user password user password plugin authentication_string
u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E u1 mysql_native_password *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
u2 u2 mysql_native_password
connection master; connection master;
DROP USER IF EXISTS u1@localhost; DROP USER IF EXISTS u1@localhost;
DROP USER u2@localhost; DROP USER u2@localhost;
...@@ -61,6 +61,6 @@ DROP USER IF EXISTS u3@localhost; ...@@ -61,6 +61,6 @@ DROP USER IF EXISTS u3@localhost;
Warnings: Warnings:
Note 1974 Can't drop user 'u3'@'localhost'; it doesn't exist Note 1974 Can't drop user 'u3'@'localhost'; it doesn't exist
connection slave; connection slave;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
user password user password plugin authentication_string
include/rpl_end.inc include/rpl_end.inc
...@@ -482,36 +482,36 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; ...@@ -482,36 +482,36 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111'; CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111';
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 N
connection slave; connection slave;
USE test_rpl; USE test_rpl;
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 N
connection master; connection master;
******************** GRANT ******************** ******************** GRANT ********************
GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost'; GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost';
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 Y localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 Y
connection slave; connection slave;
USE test_rpl; USE test_rpl;
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 Y localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 Y
connection master; connection master;
******************** REVOKE ******************** ******************** REVOKE ********************
REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost'; REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost';
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 N
connection slave; connection slave;
USE test_rpl; USE test_rpl;
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 N
connection master; connection master;
******************** SET PASSWORD ******************** ******************** SET PASSWORD ********************
......
...@@ -15,9 +15,11 @@ SELECT CURRENT_USER; ...@@ -15,9 +15,11 @@ SELECT CURRENT_USER;
disconnect user_a; disconnect user_a;
connection master; connection master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; --sorted_result
SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
sync_slave_with_master; sync_slave_with_master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; --sorted_result
SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
connection master; connection master;
CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'abcdefghijk2'; CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'abcdefghijk2';
...@@ -26,9 +28,11 @@ connection user_a; ...@@ -26,9 +28,11 @@ connection user_a;
SELECT CURRENT_USER; SELECT CURRENT_USER;
disconnect user_a; disconnect user_a;
connection master; connection master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; --sorted_result
SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
sync_slave_with_master; sync_slave_with_master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; --sorted_result
SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
connection master; connection master;
--error ER_CANNOT_USER --error ER_CANNOT_USER
...@@ -38,7 +42,8 @@ CREATE USER u1@localhost; ...@@ -38,7 +42,8 @@ CREATE USER u1@localhost;
DROP USER u3@localhost; DROP USER u3@localhost;
sync_slave_with_master; sync_slave_with_master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; --sorted_result
SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
connection master; connection master;
DROP USER IF EXISTS u1@localhost; DROP USER IF EXISTS u1@localhost;
...@@ -46,6 +51,7 @@ DROP USER u2@localhost; ...@@ -46,6 +51,7 @@ DROP USER u2@localhost;
DROP USER IF EXISTS u3@localhost; DROP USER IF EXISTS u3@localhost;
sync_slave_with_master; sync_slave_with_master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user; --sorted_result
SELECT user,password,plugin,authentication_string FROM mysql.user WHERE user LIKE 'u%' ;
--source include/rpl_end.inc --source include/rpl_end.inc
This diff is collapsed.
...@@ -16254,14 +16254,14 @@ opt_for_user: ...@@ -16254,14 +16254,14 @@ opt_for_user:
; ;
text_or_password: text_or_password:
TEXT_STRING { Lex->definer->pwhash= $1;} TEXT_STRING { Lex->definer->auth= $1;}
| PASSWORD_SYM '(' TEXT_STRING ')' { Lex->definer->pwtext= $3; } | PASSWORD_SYM '(' TEXT_STRING ')' { Lex->definer->pwtext= $3; }
| OLD_PASSWORD_SYM '(' TEXT_STRING ')' | OLD_PASSWORD_SYM '(' TEXT_STRING ')'
{ {
Lex->definer->pwtext= $3; Lex->definer->pwtext= $3;
Lex->definer->pwhash.str= Item_func_password::alloc(thd, Lex->definer->auth.str= Item_func_password::alloc(thd,
$3.str, $3.length, Item_func_password::OLD); $3.str, $3.length, Item_func_password::OLD);
Lex->definer->pwhash.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; Lex->definer->auth.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323;
} }
; ;
...@@ -16825,7 +16825,7 @@ grant_user: ...@@ -16825,7 +16825,7 @@ grant_user:
| user IDENTIFIED_SYM BY PASSWORD_SYM TEXT_STRING | user IDENTIFIED_SYM BY PASSWORD_SYM TEXT_STRING
{ {
$$= $1; $$= $1;
$1->pwhash= $5; $1->auth= $5;
} }
| user IDENTIFIED_SYM via_or_with ident_or_text | user IDENTIFIED_SYM via_or_with ident_or_text
{ {
......
...@@ -16581,14 +16581,14 @@ opt_for_user: ...@@ -16581,14 +16581,14 @@ opt_for_user:
; ;
text_or_password: text_or_password:
TEXT_STRING { Lex->definer->pwhash= $1;} TEXT_STRING { Lex->definer->auth= $1;}
| PASSWORD_SYM '(' TEXT_STRING ')' { Lex->definer->pwtext= $3; } | PASSWORD_SYM '(' TEXT_STRING ')' { Lex->definer->pwtext= $3; }
| OLD_PASSWORD_SYM '(' TEXT_STRING ')' | OLD_PASSWORD_SYM '(' TEXT_STRING ')'
{ {
Lex->definer->pwtext= $3; Lex->definer->pwtext= $3;
Lex->definer->pwhash.str= Item_func_password::alloc(thd, Lex->definer->auth.str= Item_func_password::alloc(thd,
$3.str, $3.length, Item_func_password::OLD); $3.str, $3.length, Item_func_password::OLD);
Lex->definer->pwhash.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; Lex->definer->auth.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323;
} }
; ;
...@@ -17178,7 +17178,7 @@ grant_user: ...@@ -17178,7 +17178,7 @@ grant_user:
| user IDENTIFIED_SYM BY PASSWORD_SYM TEXT_STRING | user IDENTIFIED_SYM BY PASSWORD_SYM TEXT_STRING
{ {
$$= $1; $$= $1;
$1->pwhash= $5; $1->auth= $5;
} }
| user IDENTIFIED_SYM via_or_with ident_or_text | user IDENTIFIED_SYM via_or_with ident_or_text
{ {
......
...@@ -227,12 +227,11 @@ struct AUTHID ...@@ -227,12 +227,11 @@ struct AUTHID
struct LEX_USER: public AUTHID struct LEX_USER: public AUTHID
{ {
LEX_CSTRING plugin, auth; LEX_CSTRING plugin, auth, pwtext;
LEX_CSTRING pwtext, pwhash;
void reset_auth() void reset_auth()
{ {
pwtext.length= pwhash.length= plugin.length= auth.length= 0; pwtext.length= plugin.length= auth.length= 0;
pwtext.str= pwhash.str= 0; pwtext.str= 0;
plugin.str= auth.str= ""; plugin.str= auth.str= "";
} }
}; };
......
...@@ -485,36 +485,36 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; ...@@ -485,36 +485,36 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111'; CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111';
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 N
connection slave; connection slave;
USE test_rpl; USE test_rpl;
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 N
connection master; connection master;
******************** GRANT ******************** ******************** GRANT ********************
GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost'; GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost';
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 Y localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 Y
connection slave; connection slave;
USE test_rpl; USE test_rpl;
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 Y localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 Y
connection master; connection master;
******************** REVOKE ******************** ******************** REVOKE ********************
REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost'; REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost';
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 N
connection slave; connection slave;
USE test_rpl; USE test_rpl;
SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password plugin authentication_string select_priv host user password plugin authentication_string select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N localhost user_test_rpl mysql_native_password *1111111111111111111111111111111111111111 N
connection master; connection master;
******************** SET PASSWORD ******************** ******************** SET PASSWORD ********************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment