]> granicus.if.org Git - postgresql/commitdiff
Fix bug in PostgresNode::query_hash's split() call.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Jul 2017 21:22:09 +0000 (17:22 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Jul 2017 21:22:09 +0000 (17:22 -0400)
By default, Perl's split() function drops trailing empty fields,
which is not what we want here.  Oversight in commit fb093e4cb.
We'd managed to miss it thus far thanks to the very limited usage
of this function.

Discussion: https://postgr.es/m/14837.1499029831@sss.pgh.pa.us

src/test/perl/PostgresNode.pm

index 4346423a0df99a75371c9f319bbd031277eb2aaf..bb2f39e508984fba32f082648a4db42ed39ce1d2 100644 (file)
@@ -1533,7 +1533,7 @@ sub query_hash
        #
        my %val;
        @val{@columns} =
-         $result ne '' ? split(qr/\|/, $result) : ('',) x scalar(@columns);
+         $result ne '' ? split(qr/\|/, $result, -1) : ('',) x scalar(@columns);
        return \%val;
 }