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:
Daniel Nichter
2012-05-10 09:55:42 -06:00
parent 5079930b72
commit f4957ba911
5 changed files with 124 additions and 19 deletions

View File

@@ -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.
# #############################################################################