mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
PT-1114 pt-table-checksum fails when table is empty
This commit is contained in:
@@ -75,6 +75,14 @@ sub index_length {
|
||||
n_index_cols => $n_index_cols,
|
||||
);
|
||||
|
||||
if (!$vals) {
|
||||
# Maybe the table is empty ...
|
||||
my @row = $cxn->dbh()->selectrow_array('SELECT COUNT(*) FROM '.$args{tbl}->{name});
|
||||
if ($row[0] == 0) {
|
||||
PTDEBUG && _d('Table '.$args{tbl}->{name}.' is empty');
|
||||
return undef, undef;
|
||||
}
|
||||
}
|
||||
# Make an EXPLAIN query to scan the range and execute it.
|
||||
my $sql = $self->_make_range_query(
|
||||
%args,
|
||||
|
Reference in New Issue
Block a user