Hi all,

I recently had to restore from a backup and discovered that mysql didn't want to re-create a table which had the minus symbol (-) in it, eg

DROP TABLE IF EXISTS Postcodes;
CREATE TABLE Postcodes (
DanPK mediumint(8) unsigned NOT NULL auto_increment,
MyStamp timestamp(14) NOT NULL,
Postcode smallint(2) NOT NULL default '0',
Location varchar(100) default NULL,
State char(3) default NULL,
RegionID mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (DanPK),
UNIQUE KEY IDX_Postcode-Location (Postcode,Location)
) TYPE=MyISAM;

I had added the index with MySQLCC (I think) and the database had been working fine as far as I could tell (minus the crash this morning). The table def is from mysqldump --opt, which I use each night, in combination with the --log-update option to assist in disaster recovery.

When I tried to restore from the backup (mysqldump output) it gave me a syntax error around the -Location bit.

But it _did_ let me create the index like this before. Thinking about it more, I probably shouldn't have used a minus. I can see why that would be reserved. Any chance of enforcing that in alter table commands (which I would have used to get the index there), or is it considered too expensive to do these kinds of checks?


--
Daniel Kasak
IT Developer
* NUS Consulting Group*
Level 18, 168 Walker Street
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: www.nusconsulting.com


---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to