# Generate a database with a name made of a range of ASCII characters.
sub generate_db
{
- my ($node, $from_char, $to_char) = @_;
+ my ($node, $prefix, $from_char, $to_char, $suffix) = @_;
- my $dbname = '';
+ my $dbname = $prefix;
for my $i ($from_char .. $to_char)
{
next if $i == 7 || $i == 10 || $i == 13; # skip BEL, LF, and CR
$dbname = $dbname . sprintf('%c', $i);
}
- # Exercise backslashes adjacent to double quotes, a Windows special
- # case.
- $dbname = '\\"\\' . $dbname . '\\\\"\\\\\\';
+ $dbname .= $suffix;
$node->command_ok([ 'createdb', $dbname ]);
}
{
# Default is to use pg_regress to set up the old instance.
- # Create databases with names covering most ASCII bytes
- generate_db($oldnode, 1, 45);
- generate_db($oldnode, 46, 90);
- generate_db($oldnode, 91, 127);
+ # Create databases with names covering most ASCII bytes. The
+ # first name exercises backslashes adjacent to double quotes, a
+ # Windows special case.
+ generate_db($oldnode, 'regression\\"\\', 1, 45, '\\\\"\\\\\\');
+ generate_db($oldnode, 'regression', 46, 90, '');
+ generate_db($oldnode, 'regression', 91, 127, '');
# Grab any regression options that may be passed down by caller.
my $extra_opts = $ENV{EXTRA_REGRESS_OPTS} || "";
my $rc =
system($ENV{PG_REGRESS}
- . "$extra_opts "
+ . " $extra_opts "
. "--dlpath=\"$dlpath\" "
. "--bindir= "
. "--host="
print "=== EOF ===\n";
}
}
+ is($rc, 0, 'regression tests pass');
}
# Before dumping, get rid of objects not existing or not supported in later