Commit 57d58604 authored by Brandon Walts's avatar Brandon Walts
Browse files

set MySQLTransfer.pm to dump with --skip-lock-tables as a param-overridable default

parent 6ceb21c5
......@@ -54,6 +54,7 @@ sub param_defaults {
'table' => '',
'where' => undef,
'filter_cmd' => undef,
'lock_tables' => 0,
};
}
......@@ -73,6 +74,8 @@ sub param_defaults {
param('table'): table name to be copied/merged.
param('lock_tables'): [boolean] when 1, lock tables when dumping the source database. Default if not set (or set to 0) is to not lock (runs mysqldump with --skip-lock-tables)
=cut
sub fetch_input {
......@@ -120,9 +123,11 @@ sub run {
my $table = $self->param('table');
my $where = $self->param('where');
my $filter_cmd = $self->param('filter_cmd');
my $lock_tables = $self->param('lock_tables');
my $cmd = 'mysqldump '
. { 'overwrite' => '', 'topup' => '--no-create-info ', 'insertignore' => '--no-create-info --insert-ignore ' }->{$mode}
. ($lock_tables ? '' : '--skip-lock-tables ')
. $self->mysql_conn_from_dbc($src_dbc)
. " $table "
. (defined($where) ? "--where '$where' " : '')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment