Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, October 17, 2026

Diff for scripts/perl/mysql/mysql-table-copy.pl between version 1.7 and 1.8

version 1.7, 2005/05/10 09:40:39 version 1.8, 2005/05/10 09:49:25
Line 10 
Line 10 
 # Licensed under terms of GNU General Public License.  # Licensed under terms of GNU General Public License.
 # All rights reserved.  # All rights reserved.
 #  #
 # $Platon: scripts/perl/mysql/mysql-table-copy.pl,v 1.6 2005/05/10 09:19:23 nepto Exp $  # $Platon: scripts/perl/mysql/mysql-table-copy.pl,v 1.7 2005/05/10 09:40:39 nepto Exp $
   
 # TODO: - reconnect on closed connection  # TODO: - reconnect on closed connection
 #       - managment for tables with multiple KEY columns  #       - managment for tables with multiple KEY columns
Line 22  use Time::HiRes qw(gettimeofday tv_inter
Line 22  use Time::HiRes qw(gettimeofday tv_inter
 use POSIX qw(strftime);  use POSIX qw(strftime);
   
 use vars qw (  use vars qw (
         $opt_pk          $opt_pk $opt_exit
         $dbh1 $db_name1 $user1 $pass1          $dbh1 $db_name1 $user1 $pass1
         $dbh2 $db_name2 $user2 $pass2          $dbh2 $db_name2 $user2 $pass2
         $table $timeout          $table $timeout
Line 41  while ($ARGV[0] =~ /^-/) {
Line 41  while ($ARGV[0] =~ /^-/) {
         my $option = shift @ARGV;          my $option = shift @ARGV;
         if ($option eq '-pk') {          if ($option eq '-pk') {
                 $opt_pk = 1;                  $opt_pk = 1;
           } elsif ($option eq '-exit') {
                   $opt_exit = 1;
         }          }
 }  }
   
Line 51  if (! defined $db_name1 or ! defined $db
Line 53  if (! defined $db_name1 or ! defined $db
         print STDERR "  $0 [options] database=DB1,host=localhost database=DB2,host=localhost Table\n";          print STDERR "  $0 [options] database=DB1,host=localhost database=DB2,host=localhost Table\n";
         print STDERR "    [user1] [pass1] [user2] [pass2] [<time_interval>]\n";          print STDERR "    [user1] [pass1] [user2] [pass2] [<time_interval>]\n";
         print STDERR "Options:\n";          print STDERR "Options:\n";
         print STDERR "  -pk - copy/replicate primary key as well\n";          print STDERR "  -exit   exit immediately after execution\n";
           print STDERR "  -pk     copy/replicate primary key as well\n";
         exit 1;          exit 1;
 }  }
   
Line 163  while (1) {
Line 166  while (1) {
                 }                  }
         }          }
   
           last if ($opt_exit);
         sleep $timeout;          sleep $timeout;
 }  }
   

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top