List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:October 11 2002 2:45am
Subject:Re: mysqldump allows reserved words as table names, but mysql
does not
View as plain text  
At 17:19 -0400 10/10/02, dmd@stripped wrote:
>  >Description:
>         It is possible to create a table which mysqldump can dump, 
>but mysql cannot undump.
>>How-To-Repeat:

Yes.  You'll probably have better luck if you run mysqldump with
the --quote-names option.



>	Create a table with a field named 'key':
>
>CREATE TABLE `testthing` (
>`key` TINYINT NOT NULL,
>PRIMARY KEY (`key`)
>);
>
>When you run mysqldump, it gives this back:
>CREATE TABLE testthing (
>   key tinyint(4) NOT NULL default '0',
>   PRIMARY KEY  (key)
>) TYPE=MyISAM;
>
>Because key is no longer in quotes, it is rejected because it is a 
>reserved word.
>
>>Fix:
>(1) Users: Don't name fields with reserved words
>(2) mysql: Don't allow users to name fields with reserved words

Thread
mysqldump allows reserved words as table names, but mysql does notdmd11 Oct
  • Re: mysqldump allows reserved words as table names, but mysqldoes notPaul DuBois11 Oct
  • Re: mysqldump allows reserved words as table names, but mysql does notHarald Fuchs11 Oct