From: Ian Jackson Date: Sat, 22 Aug 2009 13:04:08 +0000 (+0100) Subject: Make query dumping conditional on debug X-Git-Tag: 3.4~150 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=e05f0567ea23491da8e48f892a3337f37139628f Make query dumping conditional on debug --- diff --git a/yarrg/web/query_route b/yarrg/web/query_route index e9e358a..ee726a9 100644 --- a/yarrg/web/query_route +++ b/yarrg/web/query_route @@ -207,5 +207,7 @@ for my $dd (0..$qa->{Dropdowns}-1) { <& routetrade, dbh => $dbh, islandids => \@islandids, - archipelagoes => \@archipelagoes &> + archipelagoes => \@archipelagoes, + qa => $qa + &> % } diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 9a7b036..e154f2c 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -2,6 +2,7 @@ $dbh @islandids @archipelagoes +$qa <%perl> @@ -69,10 +70,12 @@ my $sth= $dbh->prepare($stmt); $sth->execute(@query_params); +% if ($qa->{'debug'}) {
 <% $stmt |h %>
 <% join(' | ',@query_params) |h %>
 
+% } <& dumpqueryresults, sth =>$sth &>