Bug #1897 mysqlhotcopy error
Submitted: 20 Nov 2003 0:45 Modified: 22 Nov 2003 8:47
Reporter: Ethan Joffe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S1 (Critical)
Version:mysql-max-3.23.58-pc-linux-i686.tar.gz OS:Linux (redhat9.0)
Assigned to: Dean Ellis CPU Architecture:Any

[20 Nov 2003 0:45] Ethan Joffe
Description:
mysqlhotcopy fails with the following:

# mysqlhotcopy --keepold videop
Using copy suffix '_copy'
Deleting previous 'old' hotcopy directory ('/usr/local/mysql/data/videop_copy_old')
Existing hotcopy directory renamed to '/usr/local/mysql/data/videop_copy_old'
DBD::mysql::db do failed: You have an error in your SQL syntax near '` READ, `videop`.``admodule`` READ, `videop`.``admoduleShippingMethod`` READ, `v' at line 1 at /usr/local/mysql/bin/mysqlhotcopy line 438.

How to repeat:

well, it is repeatable in my installation, but I'm not sure if it is dependent on my particular tables or not.
[21 Nov 2003 10:14] Dean Ellis
Please add the output of SHOW TABLES FROM videop;

Thank you
[21 Nov 2003 10:34] Ethan Joffe
Unfortunately, this is a clients proprietary application, so I can't give you the table definitions.
Perhaps there are more specific questions you can ask?
[21 Nov 2003 11:03] Dean Ellis
I am asking for the table names, not the table definitions.

Basically, to see if mysqlhotcopy is improperly escaping table names twice, which would be a bug, or if you have bad table names.
[21 Nov 2003 13:22] Ethan Joffe
here are the table names...

CREATE TABLE ccblacklist (
CREATE TABLE sale (
CREATE TABLE saleBonus (
CREATE TABLE session (
CREATE TABLE login (
CREATE TABLE super (
CREATE TABLE admin (
CREATE TABLE campaign (
CREATE TABLE campaignAlias (
CREATE TABLE affiliate (
CREATE TABLE admodule (
CREATE TABLE shippingMethod (
CREATE TABLE admoduleShippingMethod (
CREATE TABLE layout (
CREATE TABLE bonusOffer (
CREATE TABLE bonusOfferRule (
CREATE TABLE bonusOfferConfig (
CREATE TABLE campaignBonus (
CREATE TABLE product (
CREATE TABLE bonusOfferProduct (
[22 Nov 2003 3:24] Sergei Golubchik
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/

This was fixed in the 4.0.14. Be sure that your mysqlhotcopy version is 1.19 or higher.
The actual problem is that earlier DBD versions return table names as is (and mysqlhotcopy was quoting them with backquotes), while newer ones return them already quoted - thus double backquotes.
mysqlhotcopy version 1.19+ supports all DBD versions
[22 Nov 2003 7:50] Ethan Joffe
Note the version I am using is the latest "older production" released version of 3.23, so upgrading mysql to 4.0.14 is not an option at this time. It is unclear if the 1.19+ version of mysqlhotcopy is completely compatible with 3.23.58 since it is not in the distribution? If so, you should put it into the distribution.
Please let me know, thanks.
[22 Nov 2003 8:47] Sergei Golubchik
mysqlhotcopy from 4.0 should work with the server from 3.23

other possibilities are -
 * downgrade DBD
 * patch mysqlhotcopy manually:

http://mysql.bkbits.net:8080/mysql-4.0/diffs/scripts/mysqlhotcopy.sh@1.32?nav=index.html|s...