1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

bugfix: IDENTIFIED BY clause was lost in some GRANT variants

This commit is contained in:
Sergei Golubchik
2014-11-24 15:10:51 +01:00
parent 61820bca9b
commit bc603c604d
5 changed files with 64 additions and 21 deletions

View File

@ -647,3 +647,17 @@ ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for r
# Connection 'default'.
drop user bug12602983_user@localhost;
drop database mysqltest_db;
set password=password('foobar');
create procedure sp1() select 1;
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
grant execute on procedure sp1 to current_user() identified by 'barfoo';
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO 'root'@'localhost'
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop procedure sp1;
set password='';

View File

@ -24,4 +24,19 @@ revoke all, grant option from current_role;
show grants for current_role;
Grants for r1
GRANT USAGE ON *.* TO 'r1'
set password=password('foobar');
show grants;
Grants for root@localhost
GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'r1'
grant r1 to current_user() identified by 'barfoo';
show grants;
Grants for root@localhost
GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'r1'
set password='';
drop role r1;

View File

@ -20,5 +20,10 @@ show grants for current_role;
revoke all, grant option from current_role;
show grants for current_role;
drop role r1;
set password=password('foobar');
show grants;
grant r1 to current_user() identified by 'barfoo';
show grants;
set password='';
drop role r1;

View File

@ -1040,3 +1040,11 @@ drop database mysqltest_db;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
set password=password('foobar');
create procedure sp1() select 1;
show grants;
grant execute on procedure sp1 to current_user() identified by 'barfoo';
show grants;
drop procedure sp1;
set password='';