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:
Daniel Nichter
2011-10-15 17:47:56 -06:00
parent c28461aaef
commit 07420ff78e
8 changed files with 138 additions and 300 deletions

View File

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