Bug #14741 cannot restore to a schema who's name contains the '-' character
Submitted: 8 Nov 2005 13:09 Modified: 11 Jan 2006 16:16
Reporter: Cameron Braid Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.1.4 OS:Windows (Windows XP)
Assigned to: Mike Lischke CPU Architecture:Any

[8 Nov 2005 13:09] Cameron Braid
Description:
when restoring a database backup (created via mysql administrator) i receive this error :

The MySQL Server returned this Error:
MySQL Error Nr.1064-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-staging' at line 1

The database name in my case is drivenow-staging

How to repeat:
backup ANY database using mysql administrator
open mysqladministrator's restore panel
choose the backup file
select target schema = 'New Schema...'
(note : using Target Schema = 'original schema' works fine even with a '-')
enter a name that contains a '-' for example foo-bar
click start restore

see error :

The MySQL Server returned this Error:
MySQL Error Nr.1064-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-bar' at line 1

Suggested fix:
somewhere the database name isn' being quoted in the generation of a sql statement, in relation to using a different target schema.
[9 Nov 2005 0:27] MySQL Verification Team
Thank you for the bug report.
[11 Jan 2006 16:16] Mike Lischke
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