Bug #51631 general-log flag doesn't accept "on" as a value in the my.cnf, works as command
Submitted: 2 Mar 2010 9:47 Modified: 18 Jan 2011 20:29
Reporter: Tobias Asplund Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.1.44, 5.1, 5.5.99 OS:Any
Assigned to: Magne Mæhre CPU Architecture:Any
Triage: Triaged: D3 (Medium)

[2 Mar 2010 9:47] Tobias Asplund
This confuses people a lot, even though it's documented - I have someone every week getting stuck at this because it's not logical nor consistent

Let's put this in the my.cnf
general-log-file     = /var/log/mysql/General.log
general-log          = on

mysql> show variables like 'gener%';
| Variable_name    | Value                      |
| general_log      | OFF                        | 
| general_log_file | /var/log/mysql/General.log | 
2 rows in set (0.00 sec)

mysql> SET GLOBAL general_log = on;
Query OK, 0 rows affected (0.40 sec)

mysql> show variables like 'gener%';
| Variable_name    | Value                      |
| general_log      | ON                         | 
| general_log_file | /var/log/mysql/General.log | 

How to repeat:
See example above.

Suggested fix:
general_log = 1

will both work, but since SHOW VARIABLES displays ON and not 1 for a turned on log (and SET GLOBAL accepts ON), why doesn't my.cnf do this?
[2 Mar 2010 10:12] Sveta Smirnova
Thank you for the report.

Verified as described.
[27 Oct 2010 10:33] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:


3336 Magne Mahre	2010-10-27
      Bug#51631 general-log flag doesn't accept "on" as a value in
                the my.cnf, works as command
      Different parsing mechanisms are used for command line/my.cnf 
      options  and the SQL commands.  The former only accepted
      numeric arguments, and regarded all numbers different from 0 
      as 'true'.  Any other argument was parsed as 'false' .
      This patch adds the words 'true' and 'on' as valid truth
      values for boolean option arguments.
      A test case is not provided, as the fix is simple and
      does not warrant a separate test file (no existing
      suitable test file was found)
[27 Oct 2010 11:15] Magne Mæhre
Pushed to mysql-next-mr-bugfixing (rev. 3339)
[13 Nov 2010 16:12] Bugs System
Pushed into mysql-trunk 5.6.99-m5 (revid:alexander.nozdrin@oracle.com-20101113155825-czmva9kg4n31anmu) (version source revid:vasil.dimov@oracle.com-20100629074804-359l9m9gniauxr94) (merge vers: 5.6.99-m4) (pib:21)
[13 Nov 2010 16:36] Bugs System
Pushed into mysql-next-mr (revid:alexander.nozdrin@oracle.com-20101113160336-atmtmfb3mzm4pz4i) (version source revid:vasil.dimov@oracle.com-20100629074804-359l9m9gniauxr94) (pib:21)
[16 Dec 2010 18:45] Paul Dubois
Setting report to Need Merge pending push to 5.5.x.
[10 Jan 2011 14:21] Bugs System
Pushed into mysql-trunk 5.6.2 (revid:magne.mahre@oracle.com-20110110142031-lbqoee8xm9ghh2iu) (version source revid:magne.mahre@oracle.com-20110110142031-lbqoee8xm9ghh2iu) (merge vers: 5.6.2) (pib:24)
[10 Jan 2011 14:21] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:magne.mahre@oracle.com-20110110141820-pb1t9ntti955ofu0) (version source revid:magne.mahre@oracle.com-20110110141820-pb1t9ntti955ofu0) (merge vers: 5.5.9) (pib:24)
[18 Jan 2011 20:29] Paul Dubois
Noted in 5.5.9 changelog.

Boolean system variables can be enabled at run time by setting them
to the value ON or OFF, but previously this did not work at server
startup. Now at startup such variables can be enabled by setting them
to ON or TRUE. Any other non-numeric variable is interpreted as OFF.
(Bug#46393 improves on this such that ON, TRUE, OFF, and FALSE are
recognized, and other values are invalid.)