Bug #17828 mysqldump generates invalid SQL_MODE statements, breaking restore
Submitted: 1 Mar 2006 15:21 Modified: 1 Mar 2006 17:04
Reporter: Kristian Koehntopp Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.18-max OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[1 Mar 2006 15:21] Kristian Koehntopp
Description:
When running mysqldump, set SQL_MODE statements are generated using a binary representation of the SQL_MODE flags.

On reading the generated SQL, mysql chokes on a Syntax error.

How to repeat:
Generate a dump using "mysqldump". Make sure it contains actual nonzero SQL_MODE flags by setting SQL_MODE to TRADITIONAL or something else.

The generated code looks like this:

SET @@session.sql_mode=1344274432;

If you try to load this code using "mysql", an error message is generated and the SQL_MODE is not set properly:

ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of '1344274432'

Suggested fix:
a) generate symbolic syntax ("TRADITIONAL")
b) make SET SQL_MODE understand numeric syntax

Chose any.
[1 Mar 2006 17:04] Sergei Golubchik
a duplicate of BUG#16331