Bug #34820 log_output can be set to illegal value
Submitted: 25 Feb 2008 22:03 Modified: 5 Oct 2008 18:43
Reporter: Paul DuBois
Status: Closed
Category:Server: General Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Alexander Nozdrin Target Version:
Triage: Triaged: D4 (Minor)

[25 Feb 2008 22:03] Paul DuBois
Description:
The log_output system variable indicates the current destinations for the general query
log and slow query log. Legal value are one or more of TABLE, FILE, or NONE.  However,
the value can be set to the empty string.

How to repeat:
mysql> SELECT @@GLOBAL.log_output;
+---------------------+
| @@GLOBAL.log_output |
+---------------------+
| FILE                | 
+---------------------+
1 row in set (0.00 sec)

mysql> SET GLOBAL log_output = ''; 
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT @@GLOBAL.log_output;
+---------------------+
| @@GLOBAL.log_output |
+---------------------+
|                     | 
+---------------------+
1 row in set (0.01 sec)

Suggested fix:
Disallow setting to the empty value. Other non-legal values such as 'x' are detected and
raise an error.
[26 Feb 2008 20:58] Miguel Solorzano
Thank you for the bug report.
[26 Mar 2008 18:14] 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:

  http://lists.mysql.com/commits/44467

ChangeSet@1.2575, 2008-03-26 20:16:00+03:00, anozdrin@quad.opbmk +4 -0
  A patch for Bug#34820: log_output can be set to illegal value.
  
  We have "set" variables, which can accept empty values
  (like sql_mode), and which can not (like log_output). The problem
  was that the code does not distinguish them and allow empty
  values for every set variable.
  
  The fix is to introduce an attribute of a set variable telling
  whether it can accept empty values.
[28 Mar 2008 16:08] 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:

  http://lists.mysql.com/commits/44591

ChangeSet@1.2578, 2008-03-28 18:10:04+03:00, anozdrin@quad.opbmk +4 -0
  A patch for Bug#34820: log_output can be set to illegal value.
  
  We have "set" variables, which can accept empty values
  (like sql_mode), and which can not (like log_output). The problem
  was that the code does not distinguish them and allow empty
  values for every set variable.
  
  The fix is to introduce an attribute of a set variable telling
  whether it can accept empty values.
[28 Mar 2008 16:14] Alexander Nozdrin
Pushed into 5.1-rt.
[20 Apr 2008 15:01] Bugs System
Pushed into 6.0.6-alpha
[21 Apr 2008 19:58] Paul DuBois
Noted in 6.0.6 changelog.

The log_output system variable could be set to an illegal value.

Resetting report to PQ waiting for push into 5.1.x.
[20 May 2008 23:22] Bugs System
Pushed into 5.1.25-rc
[28 Jul 2008 18:54] Bugs System
Pushed into 5.1.25-rc  (revid:sp1r-kostja@bodhi.(none)-20080520073817-17550) (version
source revid:sp1r-kostja@bodhi.(none)-20080520073817-17550) (pib:3)
[5 Oct 2008 18:43] Jon Stephens
Also documented in 5.1.25 changelog; closed.