List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 14 2000 12:45pm
Subject:Re: Small bug in mysqldump/mysql
View as plain text  
At 11:48 AM +0300 2000-03-14, Peter Zaitsev wrote:
>I have a table in the database created as the following:
>
>DROP TABLE IF EXISTS news;
>CREATE TABLE news
>
>   ID int(10) unsigned NOT NULL auto_increment,
>   LANG_ID smallint(5) unsigned DEFAULT '0' NOT NULL,
>   REG_ID smallint(5) unsigned DEFAULT '0' NOT NULL,
>   type varchar(7),
>   STATUS tinyint(3) unsigned DEFAULT '0' NOT NULL,
>   GROUP_ID smallint(5) unsigned DEFAULT '0' NOT NULL,
>   TS datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
>   HEAD varchar(155) DEFAULT '' NOT NULL,
>   BODY text DEFAULT '' NOT NULL,
>   SOURCE varchar(255) DEFAULT '' NOT NULL,
>   OBJECT_ID int(10) unsigned DEFAULT '0' NOT NULL,
>   PRIMARY KEY (ID,LANG_ID),
>   KEY TS (TS),
>
>   KEY OBJECT_ID (OBJECT_ID)
>)/*! type=MyISAM pack_keys=1 */;
>
>This is the output from  mysqldump. the problem is it seems like "SOURCE" is
>a reserver word in mysql client so I can't feed output back to mysql to have
>the tables restored.

It was made a reserved word a couple of releases back so that you
can say

source filename

in mysql and have the contents of filename read and executed.
Unfortunately, it breaks existing working code such as you
describe above.  You can work around it by giving the
--no-named-commands option on the mysql command.

Personally, I find source being a reserved word and having to
remember --no-named-commands more trouble than it's worth.

-- 
Paul DuBois, paul@stripped
Thread
Small bug in mysqldump/mysqlPeter Zaitsev14 Mar
  • Re: Small bug in mysqldump/mysqlPaul DuBois14 Mar