Merge fix-ptc-mysql-5.5-bug-919499.

This commit is contained in:
Daniel Nichter
2012-05-18 09:52:34 -06:00
3 changed files with 47 additions and 23 deletions

View File

@@ -5886,6 +5886,30 @@ use sigtrap 'handler', \&sig_int, 'normal-signals';
my $oktorun = 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 {
# Reset global vars else tests will fail in strange ways.
@ARGV = @_;
@@ -6923,27 +6947,6 @@ sub 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 {
my (%args) = @_;
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";

Binary file not shown.

View File

@@ -38,7 +38,7 @@ elsif ( !$slave_dbh ) {
plan skip_all => 'Cannot connect to sandbox slave1';
}
else {
plan tests => 5;
plan tests => 7;
}
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
@@ -114,6 +114,28 @@ is_deeply(
"Bug 987393 (empty table): checksums"
) or print STDERR Dumper($rows);
# #############################################################################
# https://bugs.launchpad.net/percona-toolkit/+bug/919499
# MySQL error 1592 with MySQL 5.5.18+ and Perl 5.8
# #############################################################################
$output = output(
sub {
print `$trunk/bin/pt-table-checksum $master_dsn -t sakila.country 2>&1`;
}
);
is(
PerconaTest::count_checksum_results($output, 'errors'),
0,
"Bug 987393 (Perl 5.8 scoping): no errors"
);
is(
PerconaTest::count_checksum_results($output, 'rows'),
109,
"Bug 987393 (Perl 5.8 scoping): checksummed table"
);
# #############################################################################
# Done.
# #############################################################################