Bug #33353 Backup: restore failure if database name contains space
Submitted: 19 Dec 2007 3:20 Modified: 25 Apr 2008 17:15
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0.5-alpha OS:Linux (SUSE 10 64-bit)
Assigned to: Rafal Somla CPU Architecture:Any

[19 Dec 2007 3:20] Peter Gulutzan
Description:
I create a database named `x y`.
I back it up.
I try to restore it.
I fail, there's a syntax error message.

How to repeat:
mysql> create database `x y`;
Query OK, 1 row affected (0.00 sec)

mysql> backup database `x y` to 'b';
+-----------+
| backup_id |
+-----------+
| 1         |
+-----------+
1 row in set (3.39 sec)

mysql> restore from 'b';
ERROR 1064 (42000): 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 'y' at line 1
[19 Dec 2007 13:49] MySQL Verification Team
Thank you for the bug report. Verified as described.
[29 Dec 2007 0:47] Peter Gulutzan
I have problems restoring databases backed up with these names too:

`a``a`

`#mysql50#a-b-c`

And I have problems if the database contains this table name:
`t%1`
... but perhaps that should be a separate bug?
[25 Apr 2008 10:58] Rafal Somla
This issue has been fixed by recent changes to the backup code. The 6.0.5-alpha version works correctly with that respect.

Note that there is WL#4227 devoted to testing this aspect of backup/restore functionality.
[25 Apr 2008 17:15] Paul DuBois
Noted in 6.0.5 changelog.

RESTORE failed for databases or tables with names that contain
certain non-alphanumeric characters, such as spaces.