MDEV-22884 Assertion `grant_table || grant_table_role' failed on perfschema

when allowing access via perfschema callbacks, update
the cached GRANT_INFO to match
This commit is contained in:
Sergei Golubchik 2020-06-13 11:15:55 +02:00
parent 574ef38005
commit 9ed08f3576
3 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,7 @@
create user a@localhost;
connect a,localhost,a;
select * from performance_schema.global_status where variable_name='b';
VARIABLE_NAME VARIABLE_VALUE
connection default;
disconnect a;
drop user a@localhost;

View File

@ -0,0 +1,11 @@
--source include/not_embedded.inc
#
# MDEV-22884 Assertion `grant_table || grant_table_role' failed on perfschema
#
create user a@localhost;
connect a,localhost,a;
select * from performance_schema.global_status where variable_name='b';
connection default;
disconnect a;
drop user a@localhost;

View File

@ -8104,6 +8104,8 @@ bool check_grant(THD *thd, privilege_t want_access, TABLE_LIST *tables,
switch(access->check(orig_want_access, &t_ref->grant.privilege))
{
case ACL_INTERNAL_ACCESS_GRANTED:
t_ref->grant.privilege|= orig_want_access;
t_ref->grant.want_privilege= NO_ACL;
continue;
case ACL_INTERNAL_ACCESS_DENIED:
goto err;