summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2016-12-21 17:41:48 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2016-12-28 18:07:39 +0100
commit100f721c0aeb96f687a658586afd22a67098c4a8 (patch)
tree2d54bc4d996023e73387e1fc8b1b0955db976612 /sql/sql_acl.cc
parent143d512a2202dbd320ec9b9e37dafc36fc2b36d8 (diff)
downloadmariadb-git-100f721c0aeb96f687a658586afd22a67098c4a8.tar.gz
MDEV-11584: GRANT inside an SP does not work well on 2nd execution
Allocate password hash in statment memory
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 2ae252c2232..6334d3fa1dd 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1064,7 +1064,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);