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

Slow log: RENAME TABLE is not "admin", while ALTER TABLE..RENAME is

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1, 10.2, 10.3, 10.4
    • Fix Version/s: 10.1.39
    • Component/s: OTHER
    • Labels:
      None

      Description

      RENAME TABLE is not an "admin" command from the point of view of slow log. Its alias "ALTER TABLE..RENAME" is. They should be both "admin" for consistency.

      This script demonstrates that RENAME TABLE does not honor log_slow_filter='admin':

      SET @@GLOBAL.slow_query_log=OFF;
      SET @@GLOBAL.log_output='TABLE';
      TRUNCATE TABLE mysql.slow_log;
      FLUSH SLOW LOGS;
      SET @@GLOBAL.slow_query_log=ON;
       
      SET @@GLOBAL.log_slow_admin_statements=ON;
      SET log_slow_filter='admin';
      SET long_query_time=0.000001;
       
      DROP TABLE IF EXISTS t1,t2,t3;
      CREATE TABLE t1 (a INT);
      ALTER TABLE t1 RENAME t2;
      RENAME TABLE t2 TO t3;
      DROP TABLE t3;
       
      SELECT sql_text FROM mysql.slow_log;
      

      +--------------------------+
      | sql_text                 |
      +--------------------------+
      | ALTER TABLE t1 RENAME t2 |
      +--------------------------+
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: