mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#48319: Server crashes on "GRANT/REVOKE ... TO CURRENT_USER"
CURRENT_USER() in GRANT ... TO CURRENT_USER() only gave us a definer, not a full user (i.e., password-element was not initiliazed). Hence dereferencing the password led to a crash. Properly initializes definers now, just so there are no misunderstandings. Also does some magic so IDENTIFIED BY ... works with CURRENT_USER().
This commit is contained in:
@ -7573,6 +7573,9 @@ void get_default_definer(THD *thd, LEX_USER *definer)
|
||||
|
||||
definer->host.str= (char *) sctx->priv_host;
|
||||
definer->host.length= strlen(definer->host.str);
|
||||
|
||||
definer->password.str= NULL;
|
||||
definer->password.length= 0;
|
||||
}
|
||||
|
||||
|
||||
@ -7624,6 +7627,8 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
|
||||
|
||||
definer->user= *user_name;
|
||||
definer->host= *host_name;
|
||||
definer->password.str= NULL;
|
||||
definer->password.length= 0;
|
||||
|
||||
return definer;
|
||||
}
|
||||
|
Reference in New Issue
Block a user