|
This bug can also be seen with the following testcase (single thread replay suffices):
CREATE TABLE mysql.host (c INT);
|
CREATE ROLE r WITH ADMIN u;
|
CREATE ROLE q WITH ADMIN r;
|
FLUSH PRIVILEGES;
|
Leads to:
|
10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)
|
mysqld: /test/10.9_dbg/sql/sql_acl.cc:6893: int merge_role_privileges(ACL_ROLE*, ACL_ROLE*, void*): Assertion `grantee->counter > 0' failed.
|
|
10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)
|
Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
[Current thread is 1 (Thread 0x1476cc054700 (LWP 362797))]
|
(gdb) bt
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#1 0x00001476e3fff859 in __GI_abort () at abort.c:79
|
#2 0x00001476e3fff729 in __assert_fail_base (fmt=0x1476e4195588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x564053e635c0 "grantee->counter > 0", file=0x564053e63f1d "/test/10.9_dbg/sql/sql_acl.cc", line=6893, function=<optimized out>) at assert.c:92
|
#3 0x00001476e4011006 in __GI___assert_fail (assertion=assertion@entry=0x564053e635c0 "grantee->counter > 0", file=file@entry=0x564053e63f1d "/test/10.9_dbg/sql/sql_acl.cc", line=line@entry=6893, function=function@entry=0x564053e61498 "int merge_role_privileges(ACL_ROLE*, ACL_ROLE*, void*)") at assert.c:101
|
#4 0x00005640531e2591 in merge_role_privileges (role=role@entry=0x56405579f7c8, grantee=0x56405579f718, context=context@entry=0x1476cc052a30) at /test/10.9_dbg/sql/sql_acl.cc:6893
|
#5 0x00005640531d99bb in traverse_role_graph_impl (user=<optimized out>, user@entry=0x56405579f7c8, context=context@entry=0x1476cc052a30, offset=offset@entry=112, on_node=on_node@entry=0x0, on_edge=on_edge@entry=0x5640531e2505 <merge_role_privileges(ACL_ROLE*, ACL_ROLE*, void*)>) at /test/10.9_dbg/sql/sql_acl.cc:6291
|
#6 0x00005640531e03b1 in traverse_role_graph_up (on_edge=0x5640531e2505 <merge_role_privileges(ACL_ROLE*, ACL_ROLE*, void*)>, on_node=0x0, context=0x1476cc052a30, role=0x56405579f7c8) at /test/10.9_dbg/sql/sql_acl.cc:7992
|
#7 propagate_role_grants_action (role_ptr=0x56405579f7c8, ptr=<optimized out>) at /test/10.9_dbg/sql/sql_acl.cc:7992
|
#8 0x0000564053ca7079 in my_hash_iterate (hash=hash@entry=0x56405475e060 <acl_roles>, action=action@entry=0x5640531e0340 <propagate_role_grants_action(void*, void*)>, argument=argument@entry=0x0) at /test/10.9_dbg/mysys/hash.c:808
|
#9 0x00005640531e4af4 in grant_reload (thd=thd@entry=0x147680000db8) at /test/10.9_dbg/sql/sql_acl.cc:8069
|
#10 0x00005640534203cd in reload_acl_and_cache (thd=<optimized out>, thd@entry=0x147680000db8, options=1, tables=tables@entry=0x0, write_to_binlog=write_to_binlog@entry=0x1476cc053080) at /test/10.9_dbg/sql/sql_reload.cc:88
|
#11 0x0000564053298925 in mysql_execute_command (thd=thd@entry=0x147680000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:5473
|
#12 0x000056405328267b in mysql_parse (thd=thd@entry=0x147680000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1476cc053470) at /test/10.9_dbg/sql/sql_parse.cc:8046
|
#13 0x000056405328ff79 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147680000db8, packet=packet@entry=0x14768000b699 "FLUSH PRIVILEGES", packet_length=packet_length@entry=16, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364
|
#14 0x0000564053292686 in do_command (thd=0x147680000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1408
|
#15 0x00005640533efd02 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x564055808ae8, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
|
#16 0x00005640533f020b in handle_one_connection (arg=0x564055808ae8) at /test/10.9_dbg/sql/sql_connect.cc:1312
|
#17 0x00001476e4510609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#18 0x00001476e40fc163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
And on optimized, we see this:
|
10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Optimized)
|
10.9.0-opt>FLUSH PRIVILEGES;
|
ERROR 1105 (HY000): Fatal error: mysql.host table is damaged or in unsupported 3.20 format
|
Bug confirmed present in:
MariaDB: 10.4.25 (dbg), 10.5.16 (dbg), 10.6.8 (dbg), 10.7.4 (dbg), 10.8.3 (dbg), 10.9.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (opt), 10.5.16 (opt), 10.6.8 (opt), 10.7.4 (opt), 10.8.3 (opt), 10.9.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)
|