Bug #65759 the '-' become @002 upgrade from mysql5.0.77 to mysql5.5
Submitted: 28 Jun 2012 3:12 Modified: 16 Jul 2012 8:41
Reporter: h ch Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:5.5, 5.5.27 OS:Linux
Assigned to: CPU Architecture:Any
Tags: mysqlhotcopy, upgrade
Triage: Needs Triage: D2 (Serious)

[28 Jun 2012 3:12] h ch
Description:
i upgrade my DB from mysql5.0.77 to percona server 5.5
but i find mysqlhotcopy can not backup 'fdc-new' schema,the reason is mysqlhotcopy see this schema,but when it copy files,it can not find the 'fdc-new' directory,this directory has been changed to 'fdc@002new' by mysql_upgrade

How to repeat:
create schema named 'a-b' in mysql5.0.77,then upgrade to 5.5,and run mysqlhotcopy backup this schema,it will complain " No such file or directory at /usr/bin/mysqlhotcopy line 313 "
[28 Jun 2012 13:28] Valeriy Kravchuk
So, the bug, if any, is in mysqlhotcopy client program from 5.5, right? Or do you use mysqlhotcopy from 5.0.77 against 5.5 database? Please, clarify.
[8 Jul 2012 0:09] h ch
the mysqlhotcopy is from 5.5 package
[16 Jul 2012 8:41] Valeriy Kravchuk
Even on fresh 5.5 mysqlhotcopy still does not work:

mysql> create database `a-b`;
Query OK, 1 row affected (0.01 sec)

mysql> exit
Bye
[openxs@chief 5.5]$ ls data
a@002db    chief.pid  ib_logfile0  mysql               test
chief.err  ibdata1    ib_logfile1  performance_schema

[openxs@chief 5.5]$ bin/mysqlhotcopy --user=root 'a-b'
Using copy suffix '_copy'
Cannot open dir '/home/openxs/dbs/5.5/data/a-b': No such file or directory at bin/mysqlhotcopy line 313.
[7 Dec 2012 13:50] Sebastian Lemke
try this patch - I do not know if it´s perfect, but it works for me.

---------------------------------------------------

--- /usr/bin/mysqlhotcopy       2012-11-14 23:10:45.000000000 +0100
+++ mysqlhotcopy-patched@002d   2012-12-07 14:46:38.000000000 +0100
@@ -311,6 +311,10 @@

     ## get list of files to copy
     my $db_dir = "$datadir/$db";
+
+    # Patch 20121207
+    $db_dir =~ s/-/\@002d/g;
+
     opendir(DBDIR, $db_dir )
       or die "Cannot open dir '$db_dir': $!";

@@ -397,7 +401,6 @@
     $rdb->{target} = "$datadir/$rdb->{src}$opt{suffix}";
   }
 }
-
 print Dumper( \@db_desc ) if ( $opt{debug} );

 # --- bail out if all specified databases are empty ---
@@ -424,6 +427,10 @@
 retire_directory( @existing ) if @existing && !$opt{addtodest};

 foreach my $rdb ( @db_desc ) {
+    # Patch 20121207
+    $rdb->{target} =~ s/-/\@002d/g;
+    $rdb->{src} =~ s/-/\@002d/g;
+
     my $tgt_dirpath = "$rdb->{target}";
     # Remove trailing slashes (needed for Mac OS X)
     substr($tgt_dirpath, 1) =~ s|/+$||;

---------------------------------------------------