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

SET STATEMENT slow_query_log has no effect

    XMLWordPrintable

    Details

      Description

      MariaDB [test]> set global log_output = 'TABLE', global slow_query_log = 1;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> set slow_query_log = 1;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> truncate table mysql.slow_log;
      Query OK, 0 rows affected (0.10 sec)
       
      MariaDB [test]> set long_query_time = 0.000001;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> set statement SLOW_QUERY_LOG = 0 for select sleep(0.2);
      +------------+
      | sleep(0.2) |
      +------------+
      |          0 |
      +------------+
      1 row in set (0.30 sec)

      MariaDB [test]> select * from mysql.slow_log;
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+--------------------------------------------------------+-----------+
      | start_time                 | user_host                    | query_time      | lock_time       | rows_sent | rows_examined | db   | last_insert_id | insert_id | server_id | sql_text                                               | thread_id |
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+--------------------------------------------------------+-----------+
      | 2014-11-02 01:15:20.492680 | root[root] @ localhost [::1] | 00:00:00.000213 | 00:00:00.000000 |         0 |             0 | test |              0 |         0 |         1 | set long_query_time = 0.000001                         |        11 |
      | 2014-11-02 01:15:20.798909 | root[root] @ localhost [::1] | 00:00:00.200698 | 00:00:00.000000 |         1 |             0 | test |              0 |         0 |         1 | set statement SLOW_QUERY_LOG = 0 for select sleep(0.2) |        11 |
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+--------------------------------------------------------+-----------+
      2 rows in set (0.00 sec)

      The test case is not applicable to Percona server, because in Percona slow_query_log is GLOBAL-only.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: