Bug #34180 Backup: restore fails if CREATE EVENT fails
Submitted: 30 Jan 2008 23:11 Modified: 13 Aug 2008 8:08
Reporter: Peter Gulutzan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0.5-alpha-debug OS:Linux (SUSE 10 64-bit)
Assigned to: Jørgen Løland CPU Architecture:Any

[30 Jan 2008 23:11] Peter Gulutzan
Description:
I'm using 6.0-backup.
This is the latest version, the one that doesn't
allow BACKUP DATABASE inside CREATE EVENT.

I say CREATE EVENT ... BACKUP DATABASE ...
(This fails. Okay.)
I create a table named t.
I say BACKUP DATABASE.
I say RESTORE.
The restore fails with this error message:

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 '; CREATE TABLE `t` (
  `s1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET' at line 1

How to repeat:
mysql> use test
Database changed
mysql> create event e on schedule every 1 second do backup database b to 'b';
ERROR 1314 (0A000): BACKUP is not allowed in stored procedures
mysql> create database d5;
Query OK, 1 row affected (0.00 sec)

mysql> use d5
Database changed
mysql> create table t (s1 int);
Query OK, 0 rows affected (0.01 sec)

mysql> backup database d5 to '43';
+-----------+
| backup_id |
+-----------+
| 1         |
+-----------+
1 row in set (0.39 sec)

mysql> restore from '43';
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 '; CREATE TABLE `t` (
  `s1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET' at line 1
[31 Jan 2008 0:32] MySQL Verification Team
Thank you for the bug report. Verified as described.