Commit 23cc1be2 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-11584: GRANT inside an SP does not work well on 2nd execution

Allocate password hash in statment memory
parent 283e9cf4
......@@ -8032,3 +8032,13 @@ return 1;
end |
ERROR 0A000: Not allowed to return a result set from a function
drop table t1,t2;
#
# MDEV-11584: GRANT inside an SP does not work well on 2nd execution
#
CREATE PROCEDURE sp1()
GRANT ALL PRIVILEGES ON *.* TO 'foo'@'%' IDENTIFIED BY 'pass';
CALL sp1();
CALL sp1();
drop user 'foo'@'%';
drop procedure sp1;
#End of 10.1 tests
......@@ -9504,3 +9504,17 @@ end |
--delimiter ;
drop table t1,t2;
--echo #
--echo # MDEV-11584: GRANT inside an SP does not work well on 2nd execution
--echo #
CREATE PROCEDURE sp1()
GRANT ALL PRIVILEGES ON *.* TO 'foo'@'%' IDENTIFIED BY 'pass';
CALL sp1();
CALL sp1();
drop user 'foo'@'%';
drop procedure sp1;
--echo #End of 10.1 tests
......@@ -1067,7 +1067,12 @@ static bool fix_lex_user(THD *thd, LEX_USER *user)
make_scramble= my_make_scrambled_password;
}
Query_arena *arena, backup;
arena= thd->activate_stmt_arena_if_needed(&backup);
char *buff= (char *) thd->alloc(scramble_length + 1);
if (arena)
thd->restore_active_arena(arena, &backup);
if (buff == NULL)
return true;
make_scramble(buff, user->pwtext.str, user->pwtext.length);
......
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