slow_query_log_file without "=" sign enables the general query log

Bug #1083631 reported by Travis Z.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.1
Won't Fix
Low
Unassigned
5.5
Triaged
Low
Unassigned
5.6
Triaged
Low
Unassigned
5.7
Fix Released
Low
Unassigned

Bug Description

[In:Percona Server Documentation]

I was working on a server that had the slow query log enabled over the weekend. Upon investigation it looks like the general query log gets enabled also during this process. If you simply set the slow_query_log* variables in /etc/my.cnf with no mention of the general_log it will enable the general log.

    [root@server ~]# mysql -e "show variables like '%general_log%';"
    +------------------+-----------------------------+
    | Variable_name | Value |
    +------------------+-----------------------------+
    | general_log | OFF |
    | general_log_file | /var/lib/mysql/hpbstest.log |
    +------------------+-----------------------------+
    [root@server ~]# vim /etc/my.cnf
    [root@server ~]# /etc/init.d/mysql restart
    Shutting down MySQL (Percona Server).. [ OK ]
    Starting MySQL (Percona Server).. [ OK ]
    [root@server ~]# mysql -e "show variables like '%general_log%';"
    +------------------+-----------------------------+
    | Variable_name | Value |
    +------------------+-----------------------------+
    | general_log | ON |
    | general_log_file | /var/lib/mysql/hpbstest.log |
    +------------------+-----------------------------+

    /etc/my.cnf values inserted:
    slow_query_log = 1
    slow_query_log_file /var/lib/mysql/slow.log

If I set "general_log = 0" ABOVE the slow_query_log values it is ignored and the general query log is still enabled. As long as it is set after the slow_query_log* variables it is disabled as expected.

Not sure if this is expected behavior to enable the general query log automatically when enabling the slow query log as it can cause a lot of extra overhead with disk writes on a busy server.

Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :

Hi,

I've been able to reproduce the problem. These are your two variables:

 slow_query_log = 1
 slow_query_log_file /var/lib/mysql/slow.log

See that the second variable doesn't have '=' sign. So there is the bug, slow_query_log_file without '=' enables the general query log. If you add the '=' symbol and restart mysql the general query log won't be enabled.

Thanks for your report.

tags: removed: doc
Revision history for this message
Travis Z. (travisz) wrote :

Whoops! Thanks for that Miguel, can't believe I missed the '=' sign yesterday. I had actually completely removed that line yesterday after submitting the bug report (a colleague had put it in place) and when I re-added it later in the day I used the equals sign so I ended up fixing it without realizing it :)

Thanks for your help!

Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :

You're welcome Travis. Anyway, that's not the expected behavior :) Thanks for the report.

Changed in percona-server:
status: New → Confirmed
Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :

This problem affects Percona Server 5.1, Percona Server 5.5, MySQL 5.1 and MySQL 5.5. Created a bug report on mysql.com

summary: - [DOC] Slow Query Log Enables General Query Log
+ slow_query_log_file without "=" sign enables the general query log
Stewart Smith (stewart)
Changed in percona-server:
importance: Undecided → Critical
importance: Critical → Low
status: Confirmed → Triaged
Stewart Smith (stewart)
tags: added: slow-extended
tags: added: upstream
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1952

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.