Bug #9748 mysqldump misses single quotes in strings
Submitted: 8 Apr 2005 9:19 Modified: 6 May 2005 12:22
Reporter: Axel Schwenke Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S1 (Critical)
Version:5.0.4 OS:Linux (Linux)
Assigned to: Jani Tolonen CPU Architecture:Any

[8 Apr 2005 9:19] Axel Schwenke
Description:
mysqldump misses single quotes (') in strings. When using the --opt switch, things get even worse.
This bug does not exist in 4.1.7 

How to repeat:
~ $mysql test

mysql> desc aaa;
+--------+----------+------+-----+---------+-------+
| Field  | Type     | Null | Key | Default | Extra |
+--------+----------+------+-----+---------+-------+
| id     | int(11)  | YES  |     | NULL    |       |
| string | char(10) | YES  |     | NULL    |       |
+--------+----------+------+-----+---------+-------+

mysql> select id, concat("->", string, "<-") as bbb from aaa;
+------+----------+
| id   | bbb      |
+------+----------+
|    1 | ->'<-    |
|    2 | ->''<-   |
|    3 | ->'''<-  |
|    4 | ->''''<- |
+------+----------+

~ $mysqldump --opt test aaa | fgrep INSERT
INSERT INTO `aaa` VALUES (1,'),(2,'),(3,'),(4,');

~ $mysqldump --skip-opt test aaa | fgrep INSERT
INSERT INTO `aaa` VALUES (1,'');
INSERT INTO `aaa` VALUES (2,'\'');
INSERT INTO `aaa` VALUES (3,'\'\'');
INSERT INTO `aaa` VALUES (4,'\'\'\'');
[6 May 2005 12:22] Jani Tolonen
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html