A small patch for mysqlhotcopy

2001-11-04 Thread Matthew Clegg


Hi there,

I have been attempting to use mysqlhotcopy to make a backup
copy of all of the databases on a server.  It wasn't completely 
self-evident from the Mysql manual how best to do this, so I 
tried the following:

mysqlhotcopy -u blah -p blah --regexp=.* --flushlog /blah/blah/blah/destdir

This resulted in the following error messages:

Use of uninitialized value in transliteration (tr///) at 
/usr/local/mysql/bin/mysqlhotcopy line 230.
Use of uninitialized value in regexp compilation at /usr/local/mysql/bin/mysqlhotcopy 
line 231.
Filtering tables with '(?-xism:)'
Use of uninitialized value in transliteration (tr///) at 
/usr/local/mysql/bin/mysqlhotcopy line 230.
[similar stuff repeated many times ...]
No tables to hot-copy at /usr/local/mysql/bin/mysqlhotcopy line 322.

I found that the following patch solves the problem:

diff -c mysqlhotcopy.orig mysqlhotcopy 
*** mysqlhotcopy.orig   Sun Nov  4 18:03:49 2001
--- mysqlhotcopySun Nov  4 17:53:35 2001
***
*** 227,232 
--- 227,233 
 
  ## generate regex for tables/files
  my $t_regex = $rdb-{t_regex};## assign temporary regex
+ $t_regex = .* if !defined $rdb-{t_regex}; ## MTC 2001.11.04
  my $negated = $t_regex =~ tr/~//d;## remove and count negation operator:
we don't allow ~ in table names
  $t_regex = qr/$t_regex/;  ## make regex string from user regex
   

This occurred using MySQL 3.23.37 with Linux 2.4.0.  I hope
this is of use to someone.  If this is not the preferred method
for making a copy of a database, I would be grateful for
enlightenment.

Thanks.


-- 
Matthew Clegg   |  OKbridge -- The #1 Online Bridge Club
[EMAIL PROTECTED]   |  http://www.okbridge.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail mysql-unsubscribe-##L=##[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: A small patch for mysqlhotcopy

2001-11-04 Thread Jeremy Zawodny

On Sun, Nov 04, 2001 at 08:07:36PM -0800, Matthew Clegg wrote:
 
 Hi there,
 
 I have been attempting to use mysqlhotcopy to make a backup copy of
 all of the databases on a server.  It wasn't completely self-evident
 from the Mysql manual how best to do this, so I tried the following:

[snip]

 I found that the following patch solves the problem:

[snip]

 This occurred using MySQL 3.23.37 with Linux 2.4.0.  I hope
 this is of use to someone.

I patched mysqlhotcopy a few months to fix a few bugs, and the one you
found looks really familiar.  It may be fixed already in the later
versions.  I don't recall the exact version that contained my fix,
though.

Can you try a version  3.23.40 and see if the mysqlhotcopy in it
works for you?  Or mail me privately and I'll send you a recent one.

Come to think of it, if you find my name in the script, then it's the
patched version.  If not, you probably hit the same bug that I
patched.

Jeremy
-- 
Jeremy D. Zawodny, [EMAIL PROTECTED]
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.41-max: up 59 days, processed 1,315,681,864 queries (253/sec. avg)

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php