← Back to team overview

maria-developers team mailing list archive

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

 

Hi, Oleksandr!

On Dec 21, Oleksandr Byelkin wrote:
> revision-id: 33b01257190cef414a4b0f00bf36ee6a3ceda0a7 (mariadb-10.1.20-6-g33b01257190)
> parent(s): 9e032d6150b39cf36a22e7c1503e06fae9c4016d
> committer: Oleksandr Byelkin
> timestamp: 2016-12-21 20:11:14 +0100
> message:
> 
> MDEV-11584: GRANT inside an SP does not work well on 2nd execution
> 
> Allocate password hash in statment memory
> 
> diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
> index 3f26bc2e08a..b44b120cf04 100644
> --- a/sql/sql_acl.cc
> +++ b/sql/sql_acl.cc
> @@ -1067,7 +1067,14 @@ static bool fix_lex_user(THD *thd, LEX_USER *user)
>        make_scramble= my_make_scrambled_password;
>      }
>  
> -    char *buff= (char *) thd->alloc(scramble_length + 1);
> +    char *buff;
> +    {
> +      Query_arena *arena, backup;
> +      arena= thd->activate_stmt_arena_if_needed(&backup);
> +      buff= (char *) thd->alloc(scramble_length + 1);
> +      if (arena)
> +        thd->restore_active_arena(arena, &backup);
> +    }

Ok to push, just remove the unnecessary pair of curly braces and the
indentation.

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx