mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
Fixes as per Daniel's review; Removed the --quiet usage inpt-osc's nibble_is_safe, as it was ptc cruft
This commit is contained in:
@@ -6987,15 +6987,13 @@ sub nibble_is_safe {
|
||||
|
||||
# Ensure that MySQL is using the chunk index if the table is being chunked.
|
||||
if ( !$nibble_iter->one_nibble()
|
||||
&& lc($expl->{key} || '') ne lc($nibble_iter->nibble_index() || '') ) {
|
||||
if ( !$tbl->{warned}->{not_using_chunk_index}++
|
||||
&& !$o->get('quiet') ) {
|
||||
&& lc($expl->{key} || '') ne lc($nibble_iter->nibble_index() || '') )
|
||||
{
|
||||
die "Error copying rows at chunk " . $nibble_iter->nibble_number()
|
||||
. " of $tbl->{db}.$tbl->{tbl} because MySQL chose "
|
||||
. ($expl->{key} ? "the $expl->{key}" : "no") . " index "
|
||||
. " instead of the " . $nibble_iter->nibble_index() . "index.\n";
|
||||
}
|
||||
}
|
||||
|
||||
# Ensure that the chunk isn't too large if there's a --chunk-size-limit.
|
||||
# If single-chunking the table, this has already been checked, so it
|
||||
@@ -7007,9 +7005,8 @@ sub nibble_is_safe {
|
||||
: 0;
|
||||
if ( $oversize_chunk
|
||||
&& $nibble_iter->identical_boundaries($boundary->{upper},
|
||||
$boundary->{next_lower}) ) {
|
||||
if ( !$tbl->{warned}->{oversize_chunk}++
|
||||
&& !$o->get('quiet') ) {
|
||||
$boundary->{next_lower}) )
|
||||
{
|
||||
die "Error copying rows at chunk " . $nibble_iter->nibble_number()
|
||||
. " of $tbl->{db}.$tbl->{tbl} because it is oversized. "
|
||||
. "The current chunk size limit is "
|
||||
@@ -7020,15 +7017,13 @@ sub nibble_is_safe {
|
||||
. " rows in the chunk.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Ensure that MySQL is still using the entire index.
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/1010232
|
||||
if ( !$nibble_iter->one_nibble()
|
||||
&& $tbl->{key_len}
|
||||
&& ($expl->{key_len} || 0) < $tbl->{key_len} ) {
|
||||
if ( !$tbl->{warned}->{key_len}++
|
||||
&& !$o->get('quiet') ) {
|
||||
&& ($expl->{key_len} || 0) < $tbl->{key_len} )
|
||||
{
|
||||
die "Error copying rows at chunk " . $nibble_iter->nibble_number()
|
||||
. " of $tbl->{db}.$tbl->{tbl} because MySQL used "
|
||||
. "only " . ($expl->{key_len} || 0) . " bytes "
|
||||
@@ -7036,7 +7031,6 @@ sub nibble_is_safe {
|
||||
. $tbl->{key_len} . ". See the --[no]check-plan documentation "
|
||||
. "for more information.\n";
|
||||
}
|
||||
}
|
||||
|
||||
return 1; # safe
|
||||
}
|
||||
|
@@ -152,10 +152,10 @@ like $output,
|
||||
);
|
||||
};
|
||||
|
||||
is(
|
||||
like(
|
||||
$EVAL_ERROR,
|
||||
'',
|
||||
"..unless --quiet was specified",
|
||||
qr/Error copying rows at chunk.*because MySQL chose/,
|
||||
"...even if --quiet was specified",
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user