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