]> granicus.if.org Git - postgresql/commitdiff
Fix under-quoted filename pattern in pgbench TAP test.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 18 Jan 2019 20:23:44 +0000 (15:23 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 18 Jan 2019 20:23:44 +0000 (15:23 -0500)
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

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

index c87748086ab4a1a0d74f30826356f45fc403d7d1..17323e6ca5201d74cac7324b4db6961fddb4f5ad 100644 (file)
@@ -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)