Bug 112693 - mysqlhotcopy of local Fedora DB broken after upgrade from RH9
mysqlhotcopy of local Fedora DB broken after upgrade from RH9
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
1
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Tom Lane
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-28 14:41 EST by Charles Gillet
Modified: 2013-07-02 23:00 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-03-16 20:27:41 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch that fixes things on my Fedora box backing up local DB (432 bytes, patch)
2004-02-12 20:02 EST, Charles Gillet
no flags Details | Diff

  None (edit)
Description Charles Gillet 2003-12-28 14:41:25 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Description of problem:
mysqlhotcopy --allowold -u dbuser -p dbpass dbname
/var/lib/mysql/.dbbackup

gives me 

Deleting previous 'old' hotcopy directory
('/var/lib/mysql/.dbbackup/dbname_old')
Existing hotcopy directory renamed to
'/var/lib/mysql/.dbbackup/dbname_old'
DBD::mysql::db do failed: You have an error in your SQL syntax near '`
READ' at line 1 at /usr/bin/mysqlhotcopy line 438.

This worked without fail on Redhat 9.  Perhaps the problem is in
perl-DBD-MySQL-2.9002-1


I'll leave it to the experts to determine that.


Version-Release number of selected component (if applicable):
mysql-3.23.58-4

How reproducible:
Always

Steps to Reproduce:
1. Create a mysql database with at least one table
2. Try to back the db up with the mysqlhotcopy command
mysqlhotcopy --allowold -u dbuser -p dbpass dbname /path/dbbackuparea

3. Note SQL syntax error, and no backup of the db
    

Actual Results:  Deleting previous 'old' hotcopy directory
('/var/lib/mysql/.dbbackup/dbname_old')
Existing hotcopy directory renamed to
'/var/lib/mysql/.dbbackup/dbname_old'
DBD::mysql::db do failed: You have an error in your SQL syntax near '`
READ' at line 1 at /usr/bin/mysqlhotcopy line 438.


Expected Results:  No errors, and a complete backup of the db in question.

Additional info:
Comment 1 Tom Lane 2004-02-06 17:34:17 EST
I tried to reproduce this without success on a current RHEL3 install,
which has mysql-3.23.58-1.  The mysqlhotcopy script is not different
(except in some documentation lines) from that present in RHL 8.0
(mysql-3.23.54a-4), so it's hard to believe that it broke since RHL 9.
Perhaps the error is in some underlying Perl component as the
complainant suggests?

Also: just looking at the script, it seems possible that it could get
confused if the database contains odd table names (zero-length
strings, names with embedded spaces, or suchlike) but AFAIK MySQL
doesn't accept those anyway.

Barring a more specific test case, I'll have to mark this WORKSFORME.
Comment 2 Charles Gillet 2004-02-06 17:59:42 EST
Try running Fedora, installing mysql-server, starting the daemon and
simply running "mysqlhotcopy mysql /tmp" as root.  My one install of
RHEL ES doesn't even have mysql-server (postgres only?) as an
installation option.  I will change the component to perl-DBD-MySQL
for this bug, since as you say, the script hasn't changed.
Comment 3 Charles Gillet 2004-02-12 20:02:10 EST
Created attachment 97635 [details]
Patch that fixes things on my Fedora box backing up local DB

Here's a patch I made for mysqlhotcopy that fixes things if I'm attempting to
back up the local databases on a Fedora host.  It just takes some erroneous,
extra single-ticks ('') out of one line.

I don't submit this as a fix because I haven't tested it for backing up remote
DBs.

Warning, this patches /usr/bin/mysqlhotcopy directly if run with patch -p0 <
patchfile, so back up your /usr/bin/mysqlhotcopy if you think it may break
something.
Comment 4 Charles Gillet 2004-02-19 18:54:35 EST
Setting priority low since I have a workaround.  Also clarified bug
Summary.
Comment 5 Tom Weeks 2004-03-16 11:11:18 EST
Verified patch works on Fedora Core 1 w/mysql-3.23.58-4.

Is the '' bug sourced from RH or from mysql?

Tweeks
Rackspace Managed Hosting
Comment 6 Tom Lane 2004-03-16 12:13:05 EST
This script is straight from the upstream, so it's mysql's issue.

I looked at mysql 4.0.17 and found that they've patched the code to
add backticks only if not already present in the table name, with the
notation

  # Earlier versions of DBD return table name non-quoted,
  # such as DBD-2.1012 and the newer ones, such as DBD-2.9002
  # returns it quoted. Let's have a support for both.

So evidently the critical issue is which version of DBD you have. 
That's probably why I failed to reproduce it here.

Since it looks like we're still not gonna be able to ship mysql 4.*
anytime soon :-(, I'll see about backporting this patch.
Comment 7 Charles Gillet 2004-03-16 13:01:25 EST
Thanks Tom, good to hear a fix is in the works.  Practically the
minute after I posted that patch, I figured it should test to see if
the string is already quote-wrapped.  I will generate something a
little more elegant if you want to save your cycles.  Let me know.
Comment 8 Tom Lane 2004-03-16 13:37:46 EST
I plan to just copy what's in the 4.0.17 script ... not many cycles
required ;-)
Comment 9 Tom Lane 2004-03-16 20:27:41 EST
I have patched this in 3.23.58-8 which will be in Fedora Core 2.
Comment 10 Tom Weeks 2004-04-26 04:27:32 EDT
Why not just fix your 32/64bit library issues with MySQL 4 and roll
THAT out... no one's using MySQL 3x any more.. nudge nudge..

Tweeks
Comment 11 Tom Lane 2004-04-28 09:39:12 EDT
The problem with MySQL 4 is not a library issue, it's a licensing
issue.  As long as MySQL AB stick with GPL-ing their client-side
libraries, we really can't ship 4 in Red Hat distributions, because we
have non-GPL applications that need to link to libmysql.  (No, their
recently announced FOSS exception doesn't do it for us... read the
fine print and you'll see why not.)

For all I know there may be a 32/64 bit issue too, but we'll never get
around to finding out as long as we can't legally ship the code.
Comment 12 Josh Bressers 2004-10-20 15:12:41 EDT
An errata has been issued which should help the problem 
described in this bug report. This report is therefore being 
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, 
please follow the link below. You may reopen this bug report 
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-597.html
Comment 13 Josh Bressers 2004-10-20 15:41:27 EDT
An errata has been issued which should help the problem 
described in this bug report. This report is therefore being 
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, 
please follow the link below. You may reopen this bug report 
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-569.html

Note You need to log in before you can comment on or make changes to this bug.