Bug #3546 mysqlhotcopy has a very insecure backup technique
Submitted: 22 Apr 2004 14:41 Modified: 26 Apr 2004 8:26
Reporter: Tobias Burnus Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:3.23.49 OS:Linux (Debian Linux)
Assigned to: CPU Architecture:Any

[22 Apr 2004 14:41] Tobias Burnus
Description:
If I use:

DATABASES=`cd /var/lib/mysql && find * -type d -maxdepth 1`

/etc/mysql/zedv-mysqlhotcopy --user=root --passwordfile=/etc/mysql/zedv-password --flushlog  --allowold $DATABASES $BACKUPDIR

and one database makes problems, all databases backup disappear and no backup is done.

I would expect a more fault tolerat behaviour.

How to repeat:
Deleting previous 'old' hotcopy directory ('/web/server/zedv/mysql/zedv_network_old')
Existing hotcopy directory renamed to '/web/server/zedv/mysql/zedv_network_old'
Deleting previous 'old' hotcopy directory ('/web/server/zedv/mysql/zedv_software_pool_old')
Existing hotcopy directory renamed to '/web/server/zedv/mysql/zedv_software_pool_old'
Deleting previous 'old' hotcopy directory ('/web/server/zedv/mysql/zedv_ziehm_old')
Existing hotcopy directory renamed to '/web/server/zedv/mysql/zedv_ziehm_old'
DBD::mysql::db do failed: You have an error in your SQL syntax near '-Physik1 READ, soltwisc_1.Zentral_Räume1 READ, soltwisc_2.Anreden READ, soltwisc' at line 1 at /etc/mysql/zedv-mysqlhotcopy line 443.
[26 Apr 2004 8:26] Guilhem Bichot
Hi,

>DBD::mysql::db do failed: You have an error in your SQL syntax near '-Physik1
>READ, soltwisc_1.Zentral_Räume1 READ, soltwisc_2.Anreden READ, soltwisc' at line
>1 at /etc/mysql/zedv-mysqlhotcopy line 443.

Note the "You have an error in your SQL syntax near '-Physik1":
mysqlhotcopy fails because of the dash in the table name; the MySQL server requires that a table name with a dash be quoted with ` `, and the old mysqlhotcopy (3.23.49) which you are using did not quote (which is a bug); this bug is fixed since March 2002, (in MySQL 3.23 and 4.0) so we recommend that you upgrade mysqlhotcopy.
It would not make much sense for mysqlhotcopy to skip that kind of error: a syntax error reported by the MySQL server should never happen; mysqlhotcopy is supposed to send proper SQL to the server, when it's not the case we fix it.

Thank you for your bug report,
Guilhem