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

Assertion `strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0' failed in find_first_user upon double RENAME

    Details

      Description

      CREATE USER foo@localhost;
      CREATE USER bar2@localhost;
      RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost;
       
      # Cleanup
      DROP USER bar2@localhost;
      DROP USER bar3@localhost;
      

      10.4 24a45d3bd

      mysqld: /data/src/10.4/sql/sql_acl.cc:2395: uint find_first_user(T*, uint, const char*) [with T = ACL_USER; uint = unsigned int]: Assertion `strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0' failed.
      181207 20:24:06 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f2bdddd7ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000561c8e03110b in find_first_user<ACL_USER> (arr=0x7f2bc4136f90, len=6, user=0x7f2bc4015000 "bar3") at /data/src/10.4/sql/sql_acl.cc:2395
      #9  0x0000561c8e009d57 in acl_find_user_by_name (user=0x7f2bc4015000 "bar3") at /data/src/10.4/sql/sql_acl.cc:2414
      #10 0x0000561c8e00d43a in find_user_exact (host=0x7f2bc4015008 "localhost", user=0x7f2bc4015000 "bar3") at /data/src/10.4/sql/sql_acl.cc:3536
      #11 0x0000561c8e021ca0 in handle_grant_data (thd=0x7f2bc4000b00, tables=..., drop=false, user_from=0x7f2bc4015018, user_to=0x0) at /data/src/10.4/sql/sql_acl.cc:9855
      #12 0x0000561c8e023325 in mysql_rename_user (thd=0x7f2bc4000b00, list=...) at /data/src/10.4/sql/sql_acl.cc:10362
      #13 0x0000561c8e0d2236 in mysql_execute_command (thd=0x7f2bc4000b00) at /data/src/10.4/sql/sql_parse.cc:5421
      #14 0x0000561c8e0da216 in mysql_parse (thd=0x7f2bc4000b00, rawbuf=0x7f2bc4014da8 "RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost", length=77, parser_state=0x7f2bd3f6a600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8092
      #15 0x0000561c8e0c74f4 in dispatch_command (command=COM_QUERY, thd=0x7f2bc4000b00, packet=0x7f2bc400b411 "RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost", packet_length=77, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
      #16 0x0000561c8e0c5f18 in do_command (thd=0x7f2bc4000b00) at /data/src/10.4/sql/sql_parse.cc:1396
      #17 0x0000561c8e231b12 in do_handle_one_connection (connect=0x561c91c66a40) at /data/src/10.4/sql/sql_connect.cc:1402
      #18 0x0000561c8e231896 in handle_one_connection (arg=0x561c91c66a40) at /data/src/10.4/sql/sql_connect.cc:1308
      #19 0x0000561c8e6e8862 in pfs_spawn_thread (arg=0x561c91bc6b40) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #20 0x00007f2bdf893494 in start_thread (arg=0x7f2bd3f6b700) at pthread_create.c:333
      #21 0x00007f2bdde9493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      No obvious problem on a non-debug build.

        Attachments

          Activity

            People

            • Assignee:
              wlad Vladislav Vaintroub
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: