Bug #20703 mysqlhotcopy regular expression table select is broken
Submitted: 26 Jun 2006 19:14 Modified: 27 Jun 2006 18:34
Reporter: David Scott Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S1 (Critical)
Version:4.1 OS:Linux (RH Linux)
Assigned to: Assigned Account CPU Architecture:Any

[26 Jun 2006 19:14] David Scott
Description:
You are supposed to be able to select DB tables based on a regular expression select in mysqlhotcopy, but this does not work.  The reason is that the $dbh->tables() function returns a list with quotes "`" around each list element, which can get in the way of the regular expression match.  The solution is to get rid of the quote characters.

Unfortunately there doesn't appear to be a workaround unless you patch the Perl code.

How to repeat:
I have tables service_t and service_t_2006_6_24 in my database.  Doing a match on service_t picks up service_t_2006_6_24 as well.  Putting a '$' at the end of the regular expression causes it to fail.

Suggested fix:
Following is a diff between my fix to mysqlhotcopy (>) and the distributed version:

822a823
>     @dbh_tables = map { $_ =~ s/\`//g; $_ } @dbh_tables;

There might be a better way to fix this.
[27 Jun 2006 18:34] Sveta Smirnova
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

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

This bug has already fixed http://bugs.mysql.com/bug.php?id=8136