]> granicus.if.org Git - postgresql/commitdiff
Don't assume expr is available in pgbench tests
authorAndrew Dunstan <andrew@dunslane.net>
Wed, 24 Jul 2019 15:41:39 +0000 (11:41 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Wed, 24 Jul 2019 15:48:25 +0000 (11:48 -0400)
Windows hosts do not normally come with expr, so instead of using that
to test the \setshell command, use echo instead, which is fairly
universally available.

Backpatch to release 11, where this came in.

Problem found by me, patch by Fabien Coelho.

src/bin/pgbench/t/001_pgbench_with_server.pl

index 5b2d3de4ff2ba4b7fef124cc3e98a56e9259101d..3c099d768ff9cdedcf2f6289d1bebdcd2c0b2620 100644 (file)
@@ -514,7 +514,7 @@ pgbench(
                qr{processed: 1/1},
                qr{shell-echo-output}
        ],
-       [qr{command=8.: int 2\b}],
+       [qr{command=8.: int 1\b}],
        'pgbench backslash commands',
        {
                '001_pgbench_backslash_commands' => q{-- run set
@@ -526,10 +526,10 @@ pgbench(
 \sleep 0 s
 \sleep :zero
 -- setshell and continuation
-\setshell two\
-  expr \
-    1 + :one
-\set n debug(:two)
+\setshell another_one\
+  echo \
+    :one
+\set n debug(:another_one)
 -- shell
 \shell echo shell-echo-output
 }