chiark / gitweb /
Make query dumping conditional on debug
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 22 Aug 2009 13:04:08 +0000 (14:04 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 22 Aug 2009 13:04:20 +0000 (14:04 +0100)
yarrg/web/query_route
yarrg/web/routetrade

index e9e358a..ee726a9 100644 (file)
@@ -207,5 +207,7 @@ for my $dd (0..$qa->{Dropdowns}-1) {
 <& routetrade,
    dbh => $dbh,
    islandids => \@islandids,
-   archipelagoes => \@archipelagoes &>
+   archipelagoes => \@archipelagoes,
+   qa => $qa
+ &>
 % }
index 9a7b036..e154f2c 100644 (file)
@@ -2,6 +2,7 @@
 $dbh
 @islandids
 @archipelagoes
+$qa
 </%args>
 <%perl>
 
@@ -69,10 +70,12 @@ my $sth= $dbh->prepare($stmt);
 $sth->execute(@query_params);
 
 </%perl>
+% if ($qa->{'debug'}) {
 <pre>
 <% $stmt |h %>
 <% join(' | ',@query_params) |h %>
 </pre>
+% }
 
 <& dumpqueryresults, sth =>$sth &>