Bug #34834 ? Is accepted as a valid sql mode
Submitted: 26 Feb 2008 12:47 Modified: 15 Mar 2010 23:59
Reporter: Rizwan Maredia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.1.22, 5.1.24-BK, 5.0.56 OS:Any
Assigned to: CPU Architecture:Any
Tags: ?, sql mode

[26 Feb 2008 12:47] Rizwan Maredia
Description:
'?' is accepted as a valid sql mode. This value and its behavior is not documented.

How to repeat:
The following code snippet is tested against mysql test environment.

Sample Code: 
SET @@global.sql_mode = '?';
SELECT @@global.sql_mode;

Output:
SET @@global.sql_mode = '?';
SELECT @@global.sql_mode;
@@global.sql_mode
?

Suggested fix:
The value '?' should either be documented or give error.
[26 Feb 2008 12:56] Jon Stephens
Using with 5.1.24-bk on OpenSUSE 10.2: 

jon@flundra:~/bin/mysql-5.1/bin> ./mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.24-rc-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select @@sql_mode;
+------------+
| @@sql_mode |
+------------+
|            |
+------------+
1 row in set (0.00 sec)

mysql> set @@sql_mode = ?;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1
mysql> set @@sql_mode = '?';
Query OK, 0 rows affected (0.02 sec)

mysql> select @@sql_mode;
+------------+
| @@sql_mode |
+------------+
| ?          |
+------------+
1 row in set (0.00 sec)

mysql> set @@sql_mode = 'fish';
ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'fish'
mysql> select @@sql_mode;
+------------+
| @@sql_mode |
+------------+
| ?          |
+------------+
1 row in set (0.01 sec)

If this is a problem with docs, then Docs needs to be informed what this mode is supposed to do and why anyone would wish to use it.
[26 Feb 2008 14:28] Valeriy Kravchuk
Thank you for a bug report.
[6 Mar 2010 10:53] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:vvaintroub@fedora12-20091225154921-x25a5pyw1pxiwobv) (merge vers: 5.5.99) (pib:16)
[15 Mar 2010 23:59] Paul Dubois
Noted in 5.5.3 changelog.

The sql_mode system variable could be assigned the illegal value of '?'.