Commit 22491e62 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-30154: Assertion `strcasecmp(rolename, public_name.str) || acl_public ==...

MDEV-30154: Assertion `strcasecmp(rolename, public_name.str) || acl_public == role' failed in acl_update_role on GRANT ... TO PUBLIC

Reset of acl_public was made too early (before saving it to restore in case
of error).
parent a5be6c91
......@@ -100,6 +100,23 @@ delete from mysql.global_priv where user="PUBLIC";
flush privileges;
grant execute on procedure mtr.add_suppression to public;
revoke execute on procedure mtr.add_suppression from public;
#
# MDEV-30154: Assertion `strcasecmp(rolename, public_name.str) ||
# acl_public == role' failed in acl_update_role on GRANT ... TO PUBLIC
#
call mtr.add_suppression("Can't open and lock privilege tables");
USE test;
GRANT SELECT ON *.* TO PUBLIC;
LOCK TABLES mysql.time_zone WRITE,mysql.proc WRITE;
FLUSH PRIVILEGES;
ERROR HY000: Table 'db' was not locked with LOCK TABLES
LOCK TABLE nonexisting WRITE;
ERROR 42S02: Table 'test.nonexisting' doesn't exist
GRANT SELECT ON *.* TO PUBLIC;
REVOKE SELECT ON *.* FROM PUBLIC;
#
# End of 10.11 test
#
# clean up
delete from mysql.global_priv where user="PUBLIC";
flush privileges;
......@@ -109,6 +109,26 @@ flush privileges;
grant execute on procedure mtr.add_suppression to public;
revoke execute on procedure mtr.add_suppression from public;
--echo #
--echo # MDEV-30154: Assertion `strcasecmp(rolename, public_name.str) ||
--echo # acl_public == role' failed in acl_update_role on GRANT ... TO PUBLIC
--echo #
call mtr.add_suppression("Can't open and lock privilege tables");
USE test;
GRANT SELECT ON *.* TO PUBLIC;
LOCK TABLES mysql.time_zone WRITE,mysql.proc WRITE;
--error 1100
FLUSH PRIVILEGES;
--error 1146
LOCK TABLE nonexisting WRITE;
GRANT SELECT ON *.* TO PUBLIC;
REVOKE SELECT ON *.* FROM PUBLIC;
--echo #
--echo # End of 10.11 test
--echo #
-- echo # clean up
delete from mysql.global_priv where user="PUBLIC";
flush privileges;
......@@ -2918,7 +2918,6 @@ bool acl_reload(THD *thd)
int result;
DBUG_ENTER("acl_reload");
acl_public= NULL;
Grant_tables tables;
/*
......@@ -2963,6 +2962,7 @@ bool acl_reload(THD *thd)
old_mem= acl_memroot;
delete_dynamic(&acl_wild_hosts);
my_hash_free(&acl_check_hosts);
acl_public= NULL;
if ((result= acl_load(thd, tables)))
{ // Error. Revert to old list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment