summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2021-06-03 16:08:33 -0400
committerAndrew Dunstan <andrew@dunslane.net>2021-06-03 17:33:46 -0400
commit066535d411af6e77e06542d8a136576603164d5d (patch)
treecd68ee0de01a246c14a6f6d42df8fd5182a37849 /src
parentd9525c46c89d6a0d85dca0882ced98d12081bc0e (diff)
In PostgresNode.pm, don't pass SQL to psql on the command line
The Msys shell mangles certain patterns in its command line, so avoid handing arbitrary SQL to psql on the command line and instead use IPC::Run's redirection facility for stdin. This pattern is already mostly whats used, but query_poll_until() was not doing the right thing. Problem discovered on the buildfarm when a new TAP test failed on msys.
Diffstat (limited to 'src')
-rw-r--r--src/test/perl/PostgresNode.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 377b8a1514d..5c5926559d9 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -1360,8 +1360,9 @@ sub poll_query_until
while ($attempts < $max_attempts)
{
my $cmd =
- [ 'psql', '-XAt', '-c', $query, '-d', $self->connstr($dbname) ];
- my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
+ [ 'psql', '-XAt', '-d', $self->connstr($dbname) ];
+ my $result = IPC::Run::run $cmd, '<', \$query,
+ '>', \$stdout, '2>', \$stderr;
$stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp($stdout);