At 12:46 PM -0200 1/30/08, Davi Arnaut wrote:
>Paul DuBois wrote:
>> At 11:37 AM -0200 1/30/08, Davi Arnaut wrote:
>>> Alexander Nozdrin wrote:
>>>> Hi Davi,
>>>>
>>>> this is just a summary of my thoughts about the bug and the patch.
>>>>
>>>> The bug has the following parts:
>>>>
>>>> 1. sql_mode enum was extended, but mysql.proc, mysql.event
>>>> were not updated. Strictly speaking, in order to fix the bug,
>>>> you only have to fix mysql_system_tables.sql script.
>>> The patch updates the tables by changing the table definition in the
>>> mysql_system_tables.sql script.
>>>
>>>> 2. There is no test case checking that when a new sql_mode value
>>>> is added, it's added/registered in all needed places.
>>> How to test that? I've can't come up with a test that will fail when a
>>> new sql_mode is added.
>>
>> Perhaps have a reference value consisting of all the currently known
>> sql_mode values. Then set sql_mode to a value with all bits on (you
>> can set sql_mode to a numeric value; this is a "trick"), and compare
>> the result to the reference value. If they differ, a new sql_mode value
>> has been added.
>>
>
>[..]
>
>Thanks Paul! I think it will work this way.
>
>>
>> I used -E because with NO_BACKSLASH_ESCAPES enabled, the \G terminator
>> doesn't work. Perhaps that should be considered a bug. But anyway,
>> this shows how to get a value with all the currently available modes
>> enabled. That could be compared against a reference value consisting
>> of all the currently known values as of the time the test is written.
>>
>> The "?" in the middle of the string might be a problem that
>> needs to be handled specially.
>
>The "?" is a valid sql_mode, but I don't know why it exists..
It seems to correspond to MODE_NOT_USED in mysql_priv.h - I suspect
that this bit was once used for something that became obsolete.
Ah, here it is: In 4.1.0, SERIALIZABLE used to be part of the ANSI
"group" SQL mode, but was removed in 4.1.1. The relevant 4.1.0 - 4.1.1
diff looks like this:
@@ -204,22 +227,32 @@
#define MODE_PIPES_AS_CONCAT 2
#define MODE_ANSI_QUOTES 4
#define MODE_IGNORE_SPACE 8
-#define MODE_SERIALIZABLE 16
+#define MODE_NOT_USED 16
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com