mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-20 02:20:04 +08:00
PT-1554 Make QueryFormater consistent
In some OSes/Perl versions, the 'filtered' row is being printed with or without decimals. For example, in Ubuntu 16.04/Perl 5.22 it is 100.00 while in Ubuntu 18.04/Perl 5.26 it is 100. To make it consistent for tests, add a default formating string for the filtered row.
This commit is contained in:
@@ -1332,7 +1332,8 @@ sub explain_report {
|
||||
$explain .= "# *************************** $i. "
|
||||
. "row ***************************\n";
|
||||
foreach my $j ( 0 .. $#row ) {
|
||||
$explain .= sprintf "# %13s: %s\n", $sth->{NAME}->[$j],
|
||||
my $value_format = $sth->{NAME}->[$j] eq 'filtered' ? "%.02f" : "%s";
|
||||
$explain .= sprintf "# %13s: $value_format\n", $sth->{NAME}->[$j],
|
||||
defined $row[$j] ? $row[$j] : 'NULL';
|
||||
}
|
||||
$i++; # next row number
|
||||
|
||||
Reference in New Issue
Block a user