From: Tom Lane Date: Fri, 18 Jan 2019 20:23:44 +0000 (-0500) Subject: Fix under-quoted filename pattern in pgbench TAP test. X-Git-Tag: REL_12_BETA1~917 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=458a1244f1fcf407874482a93b7631ecf5303d6e;p=postgresql Fix under-quoted filename pattern in pgbench TAP test. Avoids issues if build directory's pathname contains regex metacharacters. Raúl Marín Rodríguez Discussion: https://postgr.es/m/CAM6_UM6dGdU39PKAC24T+HD9ouy0jLN9vH6163K8QEEzr__iZw@mail.gmail.com --- diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl index c87748086a..17323e6ca5 100644 --- a/src/bin/pgbench/t/001_pgbench_with_server.pl +++ b/src/bin/pgbench/t/001_pgbench_with_server.pl @@ -879,9 +879,10 @@ sub check_pgbench_logs my ($prefix, $nb, $min, $max, $re) = @_; - my @logs = glob "$prefix.*"; + my $qprefix = quotemeta($prefix); + my @logs = glob "$qprefix.*"; ok(@logs == $nb, "number of log files"); - ok(grep(/^$prefix\.\d+(\.\d+)?$/, @logs) == $nb, "file name format"); + ok(grep(/^$qprefix\.\d+(\.\d+)?$/, @logs) == $nb, "file name format"); my $log_number = 0; for my $log (sort @logs)