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

REVOKE DENY on table throws debug assertion, if DENY does not exist, but GRANT exists

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      Executing REVOKE DENY on a table entry with a non-existent privilege causes a crash in the debug build, whereas the release build reports a non-existent grant on table error
      Release build error

      13.1.0-opt>REVOKE DENY SELECT ON t1 FROM rnx_u@localhost;
      ERROR 1147 (42000): There is no such grant defined for user 'rnx_u' on host 'localhost' on table 't1'
      13.1.0-opt>
      

      MTR Testcase

      CREATE TABLE t1 (id INT);
      CREATE USER rnx_u@localhost;
      GRANT SELECT ON t1 TO rnx_u@localhost;
      REVOKE DENY SELECT ON t1 FROM rnx_u@localhost;
       
      #Cleanup 
      DROP USER rnx_u;
      DROP TABLE t1;
      

      Leads to

      MDEV-14443 CS 13.1.0 b53c2617de05d2a2445addbb90de87485645cfa3 (Debug, Clang 14.0.011.1) Build 11/06/2026

      mariadbd: /home/ramesh/MDEV-14443/server_dbg/sql/sql_error.cc:357: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char *): Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed.
      

      MDEV-14443 CS 13.1.0 b53c2617de05d2a2445addbb90de87485645cfa3 (Debug, Clang 14.0.011.1) Build 11/06/2026

      Core was generated by `/home/ramesh/MDEV-14443/MD110626-mariadb-13.1.0-linux-x86_64-dbg/bin/mariadbd -'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=8665835513408)at ./nptl/pthread_kill.c:44
      [Current thread is 1 (Thread 0x7e1ac0c2640 (LWP 483435))]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=8665835513408) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=8665835513408) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=8665835513408, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #3  0x000007e1ba242476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #4  0x000007e1ba2287f3 in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000007e1ba22871b in __assert_fail_base (fmt=0x7e1ba3dd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5ad6b3c86b97 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=0x5ad6b3c86a25 "/home/ramesh/MDEV-14443/server_dbg/sql/sql_error.cc", line=357, function=<optimized out>) at ./assert/assert.c:94
      #6  0x000007e1ba239e96 in __GI___assert_fail (assertion=0x5ad6b3c86b97 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=0x5ad6b3c86a25 "/home/ramesh/MDEV-14443/server_dbg/sql/sql_error.cc", line=357, function=0x5ad6b3c86bcd "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char *)") at ./assert/assert.c:103
      #7  0x00005ad6b2ab28fb in Diagnostics_area::set_ok_status (this=0x7e170007178, affected_rows=0, last_insert_id=0, message=0x0) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_error.cc:357
      #8  0x00005ad6b2a4098f in my_ok (thd=0x7e170000d60, affected_rows_arg=0, id=0, message=0x0) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_class.h:6609
      #9  0x00005ad6b2a14878 in mysql_table_grant (thd=0x7e170000d60, table_list=0x7e17001a610, user_list=@0x7e170006268: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7e17001a5f0, last = 0x7e17001a5f0, elements = 1}, <No data fields>}, columns=@0x7e17001ad90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5ad6b4985500 <end_of_list>, last = 0x7e17001ad90, elements = 0}, <No data fields>}, rights=SELECT_ACL, revoke_grant=true, is_deny=true) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_acl.cc:8933
      #10 0x00005ad6b2a27c25 in Sql_cmd_grant_table::execute_exact_table (this=0x7e17001ad70, thd=0x7e170000d60, table=0x7e17001a610) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_acl.cc:14337
      #11 0x00005ad6b2a282ec in Sql_cmd_grant_table::execute (this=0x7e17001ad70, thd=0x7e170000d60) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_acl.cc:14419
      #12 0x00005ad6b2b324e3 in mysql_execute_command (thd=0x7e170000d60, is_called_from_prepared_stmt=false) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_parse.cc:5905
      #13 0x00005ad6b2b215e4 in mysql_parse (thd=0x7e170000d60, rawbuf=0x7e17001a400 "REVOKE DENY SELECT ON rnx_db.t1 FROM rnx_u@localhost", length=52, parser_state=0x7e1ac0c0a10) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_parse.cc:7959
      #14 0x00005ad6b2b1e91b in dispatch_command (command=COM_QUERY, thd=0x7e170000d60, packet=0x7e17000b631 "REVOKE DENY SELECT ON rnx_db.t1 FROM rnx_u@localhost", packet_length=52, blocking=true) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_parse.cc:1903
      #15 0x00005ad6b2b22193 in do_command (thd=0x7e170000d60, blocking=true) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_parse.cc:1437
      #16 0x00005ad6b2d20c69 in do_handle_one_connection (connect=0x5ad6d1ee7800, put_in_cache=true) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_connect.cc:1503
      #17 0x00005ad6b2d20a0e in handle_one_connection (arg=0x5ad6d1f9b3c0) at /home/ramesh/MDEV-14443/server_dbg/sql/sql_connect.cc:1415
      #18 0x000007e1ba294ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #19 0x000007e1ba3268d0 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              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.