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

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.