Description:
Field names are not quoted during dump. This creates problems on re-import of the data when reserved words have been used as identifiers
How to repeat:
mysql> show create table categories\G
*************************** 1. row ***************************
Table: categories
Create Table: CREATE TABLE `categories` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`default` enum('y','n') default 'n',
`cat_owner` int(10) unsigned default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM
1 row in set (0.00 sec)
gets dumped as:
--
-- Table structure for table `categories`
--
CREATE TABLE categories (
id int(10) unsigned NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
default enum('y','n') default 'n',
cat_owner int(10) unsigned default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
- note how the "default" column is unquoted, this breaks re-import
Suggested fix:
quote all field names in mysqldump.
Workaround is to rename the field to a non-reserved word or edit the dump file manually to insert quotes.
Description: Field names are not quoted during dump. This creates problems on re-import of the data when reserved words have been used as identifiers How to repeat: mysql> show create table categories\G *************************** 1. row *************************** Table: categories Create Table: CREATE TABLE `categories` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `default` enum('y','n') default 'n', `cat_owner` int(10) unsigned default NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM 1 row in set (0.00 sec) gets dumped as: -- -- Table structure for table `categories` -- CREATE TABLE categories ( id int(10) unsigned NOT NULL auto_increment, name varchar(255) NOT NULL default '', default enum('y','n') default 'n', cat_owner int(10) unsigned default NULL, PRIMARY KEY (id) ) TYPE=MyISAM; - note how the "default" column is unquoted, this breaks re-import Suggested fix: quote all field names in mysqldump. Workaround is to rename the field to a non-reserved word or edit the dump file manually to insert quotes.