mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-20 01:16:14 +00:00
Update SchemaIterator in pt-table-sync. Make the module handle NAME_lc or not.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -88,10 +88,15 @@ sub new {
|
|||||||
$resume{tbl} = $tbl;
|
$resume{tbl} = $tbl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $engine_key
|
||||||
|
= $dbh && ($dbh->{FetchHashKeyName} || '') eq 'NAME_lc' ? 'engine'
|
||||||
|
: 'Engine';
|
||||||
|
|
||||||
my $self = {
|
my $self = {
|
||||||
%args,
|
%args,
|
||||||
resume => \%resume,
|
resume => \%resume,
|
||||||
filters => _make_filters(%args),
|
filters => _make_filters(%args),
|
||||||
|
engine_key => $engine_key,
|
||||||
};
|
};
|
||||||
|
|
||||||
return bless $self, $class;
|
return bless $self, $class;
|
||||||
@@ -376,7 +381,7 @@ sub _iterate_dbh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !$tbl_status
|
if ( !$tbl_status
|
||||||
|| $self->engine_is_allowed($tbl_status->{engine}) ) {
|
|| $self->engine_is_allowed($tbl_status->{$self->{engine_key}}) ) {
|
||||||
my $ddl;
|
my $ddl;
|
||||||
if ( my $tp = $self->{TableParser} ) {
|
if ( my $tp = $self->{TableParser} ) {
|
||||||
$ddl = $tp->get_create_table($dbh, $self->{db}, $tbl);
|
$ddl = $tp->get_create_table($dbh, $self->{db}, $tbl);
|
||||||
|
@@ -47,7 +47,7 @@ $master_dbh->do('create table test.foo (i int)');
|
|||||||
$output = `$trunk/bin/pt-table-sync --databases test --execute h=127.1,P=12345,u=msandbox,p=msandbox h=127.1,P=12348 2>&1`;
|
$output = `$trunk/bin/pt-table-sync --databases test --execute h=127.1,P=12345,u=msandbox,p=msandbox h=127.1,P=12348 2>&1`;
|
||||||
like(
|
like(
|
||||||
$output,
|
$output,
|
||||||
qr/Unknown database 'test'/,
|
qr/Table test.foo does not exist on P=12348/,
|
||||||
'Warn about --databases missing on dest host'
|
'Warn about --databases missing on dest host'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user