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

@@ -3464,7 +3464,7 @@ sub new {
my ($row_est, $mysql_index) = _get_row_estimate(%args);
my $one_nibble = !defined $args{one_nibble} || $args{one_nibble}
? $row_est < $chunk_size * $o->get('chunk-size-limit')
? $row_est <= $chunk_size * $o->get('chunk-size-limit')
: 0;
MKDEBUG && _d('One nibble:', $one_nibble ? 'yes' : 'no');
@@ -6275,10 +6275,10 @@ sub exec_nibble {
# this error message. (So don't wrap it in ts().)
die "Checksum query for table $tbl->{db}.$tbl->{tbl} "
. "caused MySQL error $code:\n"
. " Level: " . ($warning->{level} || '') . "\n"
. " Code: " . ($warning->{code} || '') . "\n"
. " Level: " . ($warning->{level} || '') . "\n"
. " Code: " . ($warning->{code} || '') . "\n"
. " Message: " . ($warning->{message} || '') . "\n"
. " Query: " . $sth->{Statement} . "\n";
. " Query: " . $sth->{nibble}->{Statement} . "\n";
}
}
@@ -7503,7 +7503,7 @@ Only read default options from the given file
=item * h
dsn: host; copy: no
dsn: host; copy: yes
Connect to host.