mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-8280: crash in 'show global status' with --skip-grant-tables
The crash was caused by attempting to use a hashtable without it getting initialized, due to the --skip-grant-tables switch.
This commit is contained in:
@ -10383,11 +10383,14 @@ static int show_column_grants(THD *thd, SHOW_VAR *var, char *buff,
|
||||
var->type= SHOW_ULONG;
|
||||
var->value= buff;
|
||||
*(ulong *)buff= 0;
|
||||
mysql_rwlock_rdlock(&LOCK_grant);
|
||||
mysql_mutex_lock(&acl_cache->lock);
|
||||
my_hash_iterate(&column_priv_hash, count_column_grants, buff);
|
||||
mysql_mutex_unlock(&acl_cache->lock);
|
||||
mysql_rwlock_unlock(&LOCK_grant);
|
||||
if (initialized)
|
||||
{
|
||||
mysql_rwlock_rdlock(&LOCK_grant);
|
||||
mysql_mutex_lock(&acl_cache->lock);
|
||||
my_hash_iterate(&column_priv_hash, count_column_grants, buff);
|
||||
mysql_mutex_unlock(&acl_cache->lock);
|
||||
mysql_rwlock_unlock(&LOCK_grant);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user