summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2017-12-16 08:58:21 +0100
committerYorhel <git@yorhel.nl>2017-12-16 08:58:21 +0100
commit56c6772aa792122931f415c3049491c685f678a4 (patch)
treecdeaba91a6f8288c6317674c3982304708b6a2a6 /lib/VNDB
parent98e1987906e3bf036f97c54bc10108b7ccf16912 (diff)
Fix query debugging output with new TUWF
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/Util/LayoutHTML.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm
index e2aca0fd..5cb266f4 100644
--- a/lib/VNDB/Util/LayoutHTML.pm
+++ b/lib/VNDB/Util/LayoutHTML.pm
@@ -189,10 +189,12 @@ sub htmlFooter { # %options => { pref_code => 1 }
if($self->debug) {
lit "\n<!--\n SQL Queries:\n";
for (@{$self->{_TUWF}{DB}{queries}}) {
- my $q = !ref $_->[0] ? $_->[0] :
- $_->[0][0].(exists $_->[0][1] ? ' | "'.join('", "', map defined()?$_:'NULL', @{$_->[0]}[1..$#{$_->[0]}]).'"' : '');
- $q =~ s/^\s//g;
- lit sprintf " [%6.2fms] %s\n", $_->[1]*1000, $q;
+ my($sql, $params, $time) = @$_;
+ lit sprintf " [%6.2fms] %s | %s\n", $time*1000, $sql,
+ join ', ',
+ map "$_:".DBI::neat($params->{$_}),
+ sort { $a =~ /^[0-9]+$/ && $b =~ /^[0-9]+$/ ? $a <=> $b : $a cmp $b }
+ keys %$params
}
lit "-->\n";
}