mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 07:30:02 +00:00
Tweaked the report format, which now includes the number of INSERTs
This commit is contained in:
@@ -8583,30 +8583,29 @@ sub main {
|
||||
line_width => 74,
|
||||
);
|
||||
$report->set_columns(
|
||||
{ name => 'Error Code', },
|
||||
{ name => 'Event', },
|
||||
{ name => 'Count', right_justify => 1 },
|
||||
{ name => 'Type', right_justify => 1 },
|
||||
);
|
||||
|
||||
$report->add_line(
|
||||
"INSERTS",
|
||||
$statistics{INSERTS},
|
||||
);
|
||||
|
||||
foreach my $code (keys %{$statistics{ignored_code}}) {
|
||||
next unless $statistics{ignored_code}->{$code};
|
||||
$report->add_line(
|
||||
$code,
|
||||
"Error $code",
|
||||
$statistics{ignored_code}->{$code},
|
||||
"Ignorable",
|
||||
)
|
||||
}
|
||||
|
||||
my $warnings_seen;
|
||||
foreach my $code (keys %{$statistics{warned_code}}) {
|
||||
$report->add_line(
|
||||
$code,
|
||||
scalar @{$statistics{warned_code}->{$code}},
|
||||
"Warning",
|
||||
"Error $code",
|
||||
$statistics{warned_code}->{$code},
|
||||
);
|
||||
$warnings_seen .= join "\n",
|
||||
map { "# $_" }
|
||||
@{$statistics{warned_code}->{$code}};
|
||||
}
|
||||
|
||||
print $report->get_report();
|
||||
@@ -9475,6 +9474,8 @@ sub exec_nibble {
|
||||
);
|
||||
|
||||
my $t_end = time;
|
||||
$statistics{INSERTS}++;
|
||||
|
||||
# ###################################################################
|
||||
# End timing the query.
|
||||
# ###################################################################
|
||||
@@ -9508,8 +9509,7 @@ sub exec_nibble {
|
||||
. "a total count will be shown if --statistics was "
|
||||
. "specified.\n";
|
||||
}
|
||||
push @{ $statistics{warned_code}->{$code} ||= [] },
|
||||
$sth->{nibble}->{Statement};
|
||||
$statistics{warned_code}->{$code}++;
|
||||
}
|
||||
else {
|
||||
# This die will propagate to fail which will return 0
|
||||
|
@@ -657,10 +657,11 @@ like(
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/\#\Q Error Code Count Type\E\s*
|
||||
\#\Q ========== ===== =========\E\s*
|
||||
\#\Q 1592 1 Ignorable\E\s*
|
||||
\#\Q 1265 1 Warning\E\s*/x,
|
||||
qr/\#\Q Event Count\E\s*
|
||||
\#\Q ========== =====\E\s*
|
||||
\#\Q INSERTS 1\E\s*
|
||||
\#\Q Error 1592 1\E\s*
|
||||
\#\Q Error 1265 1\E\s*/x,
|
||||
"--statistics works as expected with 1 ignore & 1 warning"
|
||||
);
|
||||
|
||||
|
10
t/pt-online-schema-change/samples/bug_1045317.sql
Normal file
10
t/pt-online-schema-change/samples/bug_1045317.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
DROP DATABASE IF EXISTS bug_1045317;
|
||||
CREATE DATABASE bug_1045317;
|
||||
USE bug_1045317;
|
||||
CREATE TABLE `bits` (
|
||||
`id` int,
|
||||
`val` ENUM('M','E','H') NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
INSERT INTO `bits` VALUES (1, 'M'), (2, 'E'), (3, 'H');
|
Reference in New Issue
Block a user