Bug #34820 log_output can be set to illegal value
Submitted: 25 Feb 2008 21:03 Modified: 5 Oct 2008 16:43
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Alexander Nozdrin CPU Architecture:Any

[25 Feb 2008 21: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 19:58] MySQL Verification Team
Thank you for the bug report.
[26 Mar 2008 17: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 15: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 15:14] Alexander Nozdrin
Pushed into 5.1-rt.
[20 Apr 2008 13:01] Bugs System
Pushed into 6.0.6-alpha
[21 Apr 2008 17: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 21:22] Bugs System
Pushed into 5.1.25-rc
[28 Jul 2008 16: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 16:43] Jon Stephens
Also documented in 5.1.25 changelog; closed.