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..
Regards,
--
Davi Arnaut, Software Engineer
MySQL Inc, www.mysql.com
Are you MySQL certified? www.mysql.com/certification