~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to lib/DBServer/MySQL/MySQLd.pm

  • Committer: Bernt M. Johnsen
  • Date: 2010-05-19 13:34:34 UTC
  • mto: (0.67.442 randgen-sayonara)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: bernt.johnsen@sun.com-20100519133434-qznrp10jkztnqb1o
Moved call to mysqldump into DBServer/MySQLd

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
use constant MYSQLD_VALGRIND => 16;
49
49
use constant MYSQLD_VALGRIND_OPTIONS => 17;
50
50
use constant MYSQLD_VERSION => 18;
 
51
use constant MYSQLD_DUMPER => 19;
51
52
 
52
53
use constant MYSQLD_PID_FILE => "mysql.pid";
53
54
use constant MYSQLD_LOG_FILE => "mysql.err";
91
92
                                          osWindows()?"mysqld.exe":"mysqld");
92
93
    $self->[MYSQLD_BOOT_SQL] = [];
93
94
 
 
95
    $self->[MYSQLD_DUMPER] = $self->_find([$self->basedir],
 
96
                                          osWindows()?["client/Debug","client/RelWithDebugInfo","client/Release"]:["client","bin"],
 
97
                                          osWindows()?"mysqldump.exe":"mysqldump");
 
98
 
94
99
 
95
100
    ## Check for CMakestuff to get hold of source dir:
96
101
 
535
540
 
536
541
    return $v < $b;
537
542
}
 
543
 
 
544
 
 
545
sub dumper {
 
546
    return $_[0]->[MYSQLD_DUMPER];
 
547
}
 
548
 
 
549
sub dumpdb {
 
550
    my ($self,$database, $file) = @_;
 
551
    say("Dumping Mysql server ".$self->version." on port ".$self->port);
 
552
    my $dump_result = system('"'.$self->dumper.
 
553
                             "\" --hex-blob --no-tablespaces --skip-triggers --compact --order-by-primary --skip-extended-insert --no-create-info --host=127.0.0.1 --port=".
 
554
                             $self->port.
 
555
                             " --user=root $database | sort > $file");
 
556
    return $dump_result;
 
557
}