mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-24 05:15:02 +00:00
Make %ignore_code and %warn_code global to "fix" Perl 5.8 scoping/closure issue.
This commit is contained in:
@@ -5886,6 +5886,30 @@ use sigtrap 'handler', \&sig_int, 'normal-signals';
|
|||||||
my $oktorun = 1;
|
my $oktorun = 1;
|
||||||
my $print_header = 1;
|
my $print_header = 1;
|
||||||
|
|
||||||
|
# The following two hashes are used in exec_nibble().
|
||||||
|
# They're static, so they do not need to be reset in main().
|
||||||
|
# See also https://bugs.launchpad.net/percona-toolkit/+bug/919499
|
||||||
|
|
||||||
|
# Completely ignore these error codes.
|
||||||
|
my %ignore_code = (
|
||||||
|
# Error: 1592 SQLSTATE: HY000 (ER_BINLOG_UNSAFE_STATEMENT)
|
||||||
|
# Message: Statement may not be safe to log in statement format.
|
||||||
|
# Ignore this warning because we have purposely set statement-based
|
||||||
|
# replication.
|
||||||
|
1592 => 1,
|
||||||
|
);
|
||||||
|
|
||||||
|
# Warn once per-table for these error codes if the error message
|
||||||
|
# matches the pattern.
|
||||||
|
my %warn_code = (
|
||||||
|
# Error: 1265 SQLSTATE: 01000 (WARN_DATA_TRUNCATED)
|
||||||
|
# Message: Data truncated for column '%s' at row %ld
|
||||||
|
1265 => {
|
||||||
|
# any pattern
|
||||||
|
# use MySQL's message for this warning
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
sub main {
|
sub main {
|
||||||
# Reset global vars else tests will fail in strange ways.
|
# Reset global vars else tests will fail in strange ways.
|
||||||
@ARGV = @_;
|
@ARGV = @_;
|
||||||
@@ -6923,27 +6947,6 @@ sub ts {
|
|||||||
return $msg ? "$ts $msg" : $ts;
|
return $msg ? "$ts $msg" : $ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
# Completely ignore these error codes.
|
|
||||||
my %ignore_code = (
|
|
||||||
# Error: 1592 SQLSTATE: HY000 (ER_BINLOG_UNSAFE_STATEMENT)
|
|
||||||
# Message: Statement may not be safe to log in statement format.
|
|
||||||
# Ignore this warning because we have purposely set statement-based
|
|
||||||
# replication.
|
|
||||||
1592 => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
# Warn once per-table for these error codes if the error message
|
|
||||||
# matches the pattern.
|
|
||||||
my %warn_code = (
|
|
||||||
# Error: 1265 SQLSTATE: 01000 (WARN_DATA_TRUNCATED)
|
|
||||||
# Message: Data truncated for column '%s' at row %ld
|
|
||||||
1265 => {
|
|
||||||
# any pattern
|
|
||||||
# use MySQL's message for this warning
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
sub exec_nibble {
|
sub exec_nibble {
|
||||||
my (%args) = @_;
|
my (%args) = @_;
|
||||||
my @required_args = qw(Cxn tbl NibbleIterator Retry Quoter OptionParser);
|
my @required_args = qw(Cxn tbl NibbleIterator Retry Quoter OptionParser);
|
||||||
@@ -7089,7 +7092,6 @@ sub exec_nibble {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
my $line_fmt = "%14s %6s %6s %8s %7s %7s %7s %-s\n";
|
my $line_fmt = "%14s %6s %6s %8s %7s %7s %7s %-s\n";
|
||||||
|
Reference in New Issue
Block a user