mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 00:47:44 +00:00
Don't crash on empty tables with --chunk-size-limit=0. Don't crash trying to print MySQL warning. Finish updating (all the important) tests.
This commit is contained in:
@@ -39,7 +39,7 @@ if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
}
|
||||
else {
|
||||
plan tests => 29;
|
||||
plan tests => 30;
|
||||
}
|
||||
|
||||
my $q = new Quoter();
|
||||
@@ -602,6 +602,28 @@ cmp_ok(
|
||||
"row_estimate()"
|
||||
);
|
||||
|
||||
|
||||
# ############################################################################
|
||||
# Empty table.
|
||||
# ############################################################################
|
||||
$ni = make_nibble_iter(
|
||||
db => 'mysql',
|
||||
tbl => 'host',
|
||||
argv => [qw(--tables mysql.host --chunk-size-limit 0)],
|
||||
);
|
||||
|
||||
@rows = ();
|
||||
while (my $row = $ni->next()) {
|
||||
push @rows, @$row;
|
||||
}
|
||||
|
||||
is_deeply(
|
||||
\@rows,
|
||||
[ ],
|
||||
"--chunk-size-limit 0 on empty table"
|
||||
);
|
||||
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
Reference in New Issue
Block a user