[SRU] Invalid db.table name 'g2_AccessMap' at /usr/bin/mysqlhotcopy line 845

Bug #197606 reported by Ralf Hildebrandt
10
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Ubuntu)
Fix Released
Undecided
Unassigned
Hardy
Fix Released
Undecided
Unassigned

Bug Description

Bug 162393 seems related, but didn't fix the problem.

This is:
ii mysql-server-5.0 5.0.51a-1ubuntu1 MySQL database server binaries
on hardy.

Command that lead to the error was:

/usr/bin/mysqlhotcopy --flushlog --user=debian-sys-maint --password=CnRZpfn8OVjuc89s gallery2 20080302/gallery2
Invalid db.table name 'g2_AccessMap' at /usr/bin/mysqlhotcopy line 845.
/usr/bin/mysqlhotcopy --flushlog --user=debian-sys-maint --password=CnRZpfn8OVjuc89s mysql 20080302/mysql
Invalid db.table name 'columns_priv' at /usr/bin/mysqlhotcopy line 845.

Mathias Gug (mathiaz)
description: updated
Revision history for this message
s.fussenegger (stf+ubuntu-launchpad) wrote :

Same problem here

using hardy:
ii libdbd-mysql-perl 4.005-1 A Perl5 database interface to the MySQL data
ii libmysqlclient15off 5.0.51a-3ubuntu5 MySQL database client library
ii mysql-client-5.0 5.0.51a-3ubuntu5 MySQL database client binaries
ii mysql-common 5.0.51a-3ubuntu5 MySQL database common files
ii mysql-server-5.0 5.0.51a-3ubuntu5 MySQL database server binaries

from mysqlhotcopy

sub quote_names {
  my ( $name ) = @_;
  # given a db.table name, add quotes

  my ($db, $table, @cruft) = split( /\./, $name );
  die "Invalid db.table name '$name'" if (@cruft || !defined $db || !defined $table );

  # 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.
  $table=~ s/\`//g;
  return "`$db`.`$table`";
}

so $name should be database.table rather than table only. maybe this was caused by the fix for bug 162393

Revision history for this message
karthik (karumugham) wrote :

Changing line 837 to read "return (map { $db . "." . $_->[0] } @$tables);" seems to fix the problem for now.

--- mysqlhotcopy.orig 2008-03-28 00:16:20.000000000 -0400
+++ mysqlhotcopy 2008-04-26 16:48:30.519297639 -0400
@@ -834,7 +834,7 @@
         } || [];
     warn "Unable to retrieve list of tables in $db: $@" if $@;

- return (map { $_->[0] } @$tables);
+ return (map { $db . "." . $_->[0] } @$tables);
 }

 sub quote_names {

Revision history for this message
Joachim Davain (joachim-davain) wrote :

Same problem.

Yes, adding the $db line 837 fixes the problem for now.

Revision history for this message
Chuck Short (zulcss) wrote :

Statement of impact:

This prevents the user from using the mysqlhotcopy script.

How this bug has been addressed:

Hardy originally had a broken mysqlhotcopy script that we tried to fix in the hardy dev cycle but there was a typo in the patch. I have updated the patch for 8.04.1 and included it in this SRU request.

TEST CASE:

1. Install mysql.
2. Create a database called test
3. Run the mysqlhotcopy command: mysqlhotcopy --username=root test /tmp/test.data
4. The command will not work properly and you will probably get the folloiwng error "Invalid db.table name 'g2_AccessMap' at /usr/bin/mysqlhotcopy line 845."

If you have any questions please let me know.

Thanks
chuck

Revision history for this message
Chuck Short (zulcss) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here

Changed in mysql-dfsg-5.0:
status: New → Fix Committed
Steve Langasek (vorlon)
Changed in mysql-dfsg-5.0:
milestone: none → ubuntu-8.04.1
Revision history for this message
Adam Sommer (asommer) wrote :

The -proposed package mysqlhotcopy worked fine for me.

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in mysql-dfsg-5.0:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Copied hardy-proposed to intrepid.

Changed in mysql-dfsg-5.0:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.