Bug #34828 OF is taken as OFF and a value of 0 is set for variable SQL_notes
Submitted: 26 Feb 2008 12:00 Modified: 12 Nov 2009 20:18
Reporter: Salman Rawala Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.1.22, 5.1.23 OS:Windows
Assigned to: Alexander Nozdrin CPU Architecture:Any
Tags: boolean, Dynamic System Variable, OFF

[26 Feb 2008 12:00] Salman Rawala
Description:
When a value of OF is set to a boolean variable its taken as OFF or 0 instead of giving an error message while compiling.

How to repeat:
Assign Of to sql_notes and you will see that the value of variable changes to 0

SET @@session.sql_notes = OF;
SELECT @@session.sql_notes;

Output:
SET @@session.sql_notes = OF;
SELECT @@session.sql_notes;
@@session.sql_notes
0

Suggested fix:
On assigning OF, server should give error that value is incorrect.
[29 Feb 2008 9:02] Valeriy Kravchuk
Thank you for a bug report.
[1 Oct 2008 15:30] Konstantin Osipov
OF is accepted as OFF for many other 0/1 on/off variables.
Don't see it documented anywhere.

Don't see why it's a feature request.
[24 Feb 2009 11:25] 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/67348

2731 Alexander Nozdrin	2009-02-24
      A patch for Bug#34828: OF is taken as OFF and a value of 0
      is set for variable SQL_notes.
      
      The problem was that partial match was allowed for keywords.
      
      A fix is to disable partial match and require full match.
      modified:
        mysql-test/r/variables.result
        mysql-test/t/variables.test
        sql/set_var.cc
[24 Feb 2009 11:28] Alexander Nozdrin
Patch has been pushed into 6.0-runtime.
[6 Mar 2009 19:19] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090306190634-6s4zeti557q6stly) (version source revid:alik@sun.com-20090224112546-4i352talrplq5upj) (merge vers: 6.0.10-alpha) (pib:6)
[12 Mar 2009 13:47] Konstantin Osipov
We're becoming more strict with input.
I think we should make the incompatible change, fix the documentation, and accept the current patch.
[12 Mar 2009 18:41] Paul DuBois
Noted in 6.0.11 changelog.

For system variables that take values of ON or OFF, OF was accepted
as a legal variable. Now system variables that take "enumeration"
values must be assigned the full value. This affects some other
variables that previously could be assigned using unambiguous
prefixes of allowable values, such as tx_isolation.
[9 Oct 2009 14:58] Alexander Nozdrin
Pushed into 5.5.0.
[12 Oct 2009 15:39] Paul DuBois
Noted in 5.5.0 changelog.
[31 Oct 2009 8:17] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091031081410-qkxmjsdzjmj840aq) (version source revid:guilhem@mysql.com-20091010123356-qfouds7ucvkvbczt) (merge vers: 6.0.14-alpha) (pib:13)
[31 Oct 2009 17:41] Paul DuBois
Already fixed in 6.0.11.
[12 Nov 2009 8:17] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version source revid:mikael@mysql.com-20091102100915-a2nbfxaqprpgptfw) (merge vers: 5.5.0-beta) (pib:13)