Description:
mysqldump generates a couple of SET statements
that use double-quotes to quote the sql_mode value.
This is a problem when reloading the dump file because
if ANSI_QUOTES is already enabled, these quoted mode
values will be treated as identifiers, not quoted strings,
and the SET statements have no effect.
How to repeat:
run mysqldump.
Suggested fix:
Delivered-To: paul-mysql.snake.net@localhost.kitebird.com
Date: Wed, 26 Jan 2005 12:36:49 -0600
From: Paul DuBois <paul@snake.net>
To: paul@mysql.com
User-Agent: Mutt/1.4i
===== mysqldump.c 1.170 vs edited =====
--- 1.170/client/mysqldump.c 2005-01-24 08:48:16 -06:00
+++ edited/mysqldump.c 2005-01-26 12:28:02 -06:00
@@ -489,7 +489,7 @@
");
}
fprintf(sql_file,
- "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=\"%s%s%s\" */;\n",
+ "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n",
path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",",
compatible_mode_normal_str);
check_io(sql_file);
@@ -863,7 +863,7 @@
cannot reconnect.
*/
sock->reconnect= 0;
- sprintf(buff, "/*!40100 SET @@SQL_MODE=\"%s\" */",
+ sprintf(buff, "/*!40100 SET @@SQL_MODE='%s' */",
compatible_mode_normal_str);
if (mysql_query_with_error_report(sock, 0, buff))
{
Description: mysqldump generates a couple of SET statements that use double-quotes to quote the sql_mode value. This is a problem when reloading the dump file because if ANSI_QUOTES is already enabled, these quoted mode values will be treated as identifiers, not quoted strings, and the SET statements have no effect. How to repeat: run mysqldump. Suggested fix: Delivered-To: paul-mysql.snake.net@localhost.kitebird.com Date: Wed, 26 Jan 2005 12:36:49 -0600 From: Paul DuBois <paul@snake.net> To: paul@mysql.com User-Agent: Mutt/1.4i ===== mysqldump.c 1.170 vs edited ===== --- 1.170/client/mysqldump.c 2005-01-24 08:48:16 -06:00 +++ edited/mysqldump.c 2005-01-26 12:28:02 -06:00 @@ -489,7 +489,7 @@ "); } fprintf(sql_file, - "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=\"%s%s%s\" */;\n", + "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", compatible_mode_normal_str); check_io(sql_file); @@ -863,7 +863,7 @@ cannot reconnect. */ sock->reconnect= 0; - sprintf(buff, "/*!40100 SET @@SQL_MODE=\"%s\" */", + sprintf(buff, "/*!40100 SET @@SQL_MODE='%s' */", compatible_mode_normal_str); if (mysql_query_with_error_report(sock, 0, buff)) {