mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-26 05:58:16 +00:00
Use --chunk-size-limit || 1 for checking if a table can be done in one chunk to avoid chunking empty tables. Checksums for empty tables are now written.
This commit is contained in:
@@ -41,7 +41,7 @@ if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
}
|
||||
else {
|
||||
plan tests => 15;
|
||||
plan tests => 16;
|
||||
}
|
||||
|
||||
my $q = new Quoter();
|
||||
@@ -252,6 +252,29 @@ ok(
|
||||
"No more boundaries"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Empty table
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/987393
|
||||
# #############################################################################
|
||||
$sb->load_file('master', "t/pt-table-checksum/samples/empty-table-bug-987393.sql");
|
||||
PerconaTest::wait_for_table($dbh, "test.test_full", "id=1");
|
||||
|
||||
$ni = make_nibble_iter(
|
||||
db => 'test',
|
||||
tbl => 'test_empty',
|
||||
argv => [qw(--databases test --chunk-size-limit 0)],
|
||||
);
|
||||
|
||||
@rows = ();
|
||||
for (1..5) {
|
||||
push @rows, $ni->next();
|
||||
}
|
||||
is_deeply(
|
||||
\@rows,
|
||||
[],
|
||||
"Empty table"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
Reference in New Issue
Block a user