Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-29131

Assertion `status == 0' failed when renaming user after deleting table roles_mapping

    XMLWordPrintable

    Details

      Description

      CREATE ROLE r;
      DROP TABLE IF EXISTS mysql.roles_mapping;
      RENAME USER current_user TO 'a'@'a';
      

      Leads to:

      10.10.0 2ccdfba8ee1af02ab17d4aff366a1c9d1883425b (Debug)

      mysqld: /test/10.10_dbg/sql/sql_acl.cc:3813: my_bool add_role_user_mapping_action(void*, void*): Assertion `status == 0' failed.
      

      10.10.0 2ccdfba8ee1af02ab17d4aff366a1c9d1883425b (Debug)

      Core was generated by `/test/MD190722-mariadb-10.10.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 0x14960cf84700 (LWP 1792489))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000149625b13859 in __GI_abort () at abort.c:79
      #2  0x0000149625b13729 in __assert_fail_base (fmt=0x149625ca9588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55917984196e "status == 0", file=0x559179842120 "/test/10.10_dbg/sql/sql_acl.cc", line=3813, function=<optimized out>) at assert.c:92
      #3  0x0000149625b24f36 in __GI___assert_fail (assertion=assertion@entry=0x55917984196e "status == 0", file=file@entry=0x559179842120 "/test/10.10_dbg/sql/sql_acl.cc", line=line@entry=3813, function=function@entry=0x55917983fd78 "my_bool add_role_user_mapping_action(void*, void*)") at assert.c:101
      #4  0x0000559178bb2756 in add_role_user_mapping_action (ptr=<optimized out>, unused=<optimized out>) at /test/10.10_dbg/sql/sql_acl.cc:3813
      #5  0x0000559179675693 in my_hash_iterate (hash=hash@entry=0x55917a147be0 <acl_roles_mappings>, action=action@entry=0x559178bb26f8 <add_role_user_mapping_action(void*, void*)>, argument=argument@entry=0x0) at /test/10.10_dbg/mysys/hash.c:808
      #6  0x0000559178ba3df2 in rebuild_role_grants () at /test/10.10_dbg/sql/sql_acl.cc:3838
      #7  0x0000559178bb87f8 in mysql_rename_user (thd=thd@entry=0x1495cc000db8, list=@0x1495cc005e70: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1495cc013d60, last = 0x1495cc013d70, elements = 2}, <No data fields>}) at /test/10.10_dbg/sql/sql_acl.cc:11166
      #8  0x0000559178c6416b in mysql_execute_command (thd=thd@entry=0x1495cc000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.10_dbg/sql/sql_parse.cc:5361
      #9  0x0000559178c4e2a4 in mysql_parse (thd=thd@entry=0x1495cc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14960cf83470) at /test/10.10_dbg/sql/sql_parse.cc:8036
      #10 0x0000559178c5b89a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1495cc000db8, packet=packet@entry=0x1495cc00b6c9 "RENAME USER current_user TO 'a'@'a'", packet_length=packet_length@entry=35, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_class.h:1364
      #11 0x0000559178c5dfa2 in do_command (thd=0x1495cc000db8, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_parse.cc:1407
      #12 0x0000559178dbf6ac in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55917b6278e8, put_in_cache=put_in_cache@entry=true) at /test/10.10_dbg/sql/sql_connect.cc:1418
      #13 0x0000559178dbfbb5 in handle_one_connection (arg=0x55917b6278e8) at /test/10.10_dbg/sql/sql_connect.cc:1312
      #14 0x0000149626022609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #15 0x0000149625c10293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.36 (dbg), 10.4.26 (dbg), 10.5.17 (dbg), 10.6.9 (dbg), 10.7.5 (dbg), 10.8.4 (dbg), 10.9.2 (dbg), 10.10.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.36 (opt), 10.4.26 (opt), 10.5.17 (opt), 10.6.9 (opt), 10.7.5 (opt), 10.8.4 (opt), 10.9.2 (opt), 10.10.0 (opt)

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.