[MDEV-7002] SET STATEMENT sql_log_off has no effect Created: 2014-11-01  Updated: 2015-03-16  Resolved: 2015-03-16

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: N/A
Fix Version/s: 10.1.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5231 Per query variables from Percona Serv... Closed
relates to MDEV-6923 Testing for SET STATEMENT .. FOR (MDE... Closed

 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.



 Comments   
Comment by Oleksandr Byelkin [ 2014-11-05 ]

The variable prohibited as a workaround.

Comment by Oleksandr Byelkin [ 2014-11-11 ]

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

Comment by Oleksandr Byelkin [ 2015-03-16 ]

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

Generated at Thu Feb 08 07:16:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.