]> granicus.if.org Git - postgresql/commitdiff
Fix -e option in contrib/intarray/bench/bench.pl.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Aug 2016 19:51:11 +0000 (15:51 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Aug 2016 19:51:11 +0000 (15:51 -0400)
As implemented, -e ran an EXPLAIN but then discarded the output, which
certainly seems pointless.  Make it print to stdout instead.  It's been
like that forever, so back-patch to all supported branches.

Daniel Gustafsson, reviewed by Andreas Scherbaum

Patch: <B97BDCB7-A3B3-4734-90B5-EDD586941629@yesql.se>

contrib/intarray/bench/bench.pl

index 4e18624b9c21bf407b1f18485386f58c85a61b84..b3097a0246173e16b9b5f604524fe404721d9f04 100755 (executable)
@@ -70,7 +70,8 @@ if ( $opt{v} ) {
 }
 
 if ( $opt{e} ) {
-       $dbi->do("explain $sql");
+       my @plan = map { "$_->[0]\n" } @{$dbi->selectall_arrayref("explain $sql")};
+       print @plan;
 }
 
 my $t0 = [gettimeofday];