Bug #34834 ? Is accepted as a valid sql mode
Submitted: 26 Feb 2008 13:47 Modified: 13 Nov 10:42
Reporter: Rizwan Maredia
Status: Patch pending
Category:Server: DML Severity:S3 (Non-critical)
Version:5.1.22, 5.1.24-BK, 5.0.56 OS:Any
Assigned to: Sergei Golubchik Target Version:
Tags: sql mode, ?
Triage: Triaged: D3 (Medium)

[26 Feb 2008 13: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 13: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 15:28] Valeriy Kravchuk
Thank you for a bug report.