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

SET STATEMENT sql_log_off has no effect

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: N/A
    • Fix Version/s: 10.1.4
    • Component/s: OTHER
    • Labels:
      None

      Description

      Test case
      set @general_log.saved = @@general_log;
      set @log_output.saved = @@log_output;
      set @sql_log_off.saved = @@sql_log_off;
      
      set global general_log = 1, log_output = 'TABLE';
      set sql_log_off = 0;
      truncate table mysql.general_log;
      select 1;
      set statement SQL_LOG_OFF = 1 for select 2;
      set SQL_LOG_OFF = 1;
      select 3;
      select * from mysql.general_log;
      
      set sql_log_off = @sql_log_off.saved;
      set global general_log = @general_log.saved;
      set global log_output = @log_output.saved;
      
      +----------------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
      | event_time                 | user_host                    | thread_id | server_id | command_type | argument                                   |
      +----------------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
      | 2014-11-01 21:23:07.658097 | root[root] @ localhost [::1] |         9 |         1 | Query        | select 1                                   |
      | 2014-11-01 21:23:07.851033 | root[root] @ localhost [::1] |         9 |         1 | Query        | set statement SQL_LOG_OFF = 1 for select 2 |
      | 2014-11-01 21:23:07.852758 | root[root] @ localhost [::1] |         9 |         1 | Query        | set SQL_LOG_OFF = 1                        |
      +----------------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
      

      Logging to file is also affected

      All the same in Percona server.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              sanja Oleksandr Byelkin added a comment -

              The variable prohibited as a workaround.

              Show
              sanja Oleksandr Byelkin added a comment - The variable prohibited as a workaround.
              Hide
              sanja Oleksandr Byelkin added a comment - - edited

              Here cause is that we write sqllog BEFORE parsing the query.

              Show
              sanja Oleksandr Byelkin added a comment - - edited Here cause is that we write sqllog BEFORE parsing the query.
              Hide
              sanja Oleksandr Byelkin added a comment -

              As far as log written before parsing we can't change it parameters, so the variable will be just prohibited in SET STATEMENT.

              Show
              sanja Oleksandr Byelkin added a comment - As far as log written before parsing we can't change it parameters, so the variable will be just prohibited in SET STATEMENT.

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: