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:
Carlos Salguero
2018-05-23 15:28:28 -03:00
parent cbe2333e92
commit 09cd07f58e
5 changed files with 12 additions and 6 deletions

View File

@@ -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