Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteaa5ebe

Browse files
committed
Improve and fix some issues in the TAP tests of pg_upgrade
This is based on a set of suggestions from Noah, with the followingchanges made:- The set of databases created in the tests are now prefixed with"regression" to not trigger any warnings with name restrictions whencompiling the code with -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS, andnow only the first name checks after the Windows case of double quotesmixed with backslashes.- Fix an issue with EXTRA_REGRESS_OPTS, which were not processed in away consistent with 027_stream_regress.pl (missing space between theoption string and pg_regress). This got introduced in7dd3ee5.- Add a check on the exit code of the pg_regress command, to catchfailures after running the regression tests.Reviewed-by: Noah MischDiscussion:https://postgr.es/m/YoHhWD5vQzb2mmiF@paquier.xyz
1 parent5e5fa32 commiteaa5ebe

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

‎src/bin/pg_upgrade/t/002_pg_upgrade.pl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@
1313
# Generate a database with a name made of a range of ASCII characters.
1414
subgenerate_db
1515
{
16-
my ($node,$from_char,$to_char) =@_;
16+
my ($node,$prefix,$from_char,$to_char,$suffix) =@_;
1717

18-
my$dbname ='';
18+
my$dbname =$prefix;
1919
formy$i ($from_char ..$to_char)
2020
{
2121
nextif$i == 7 ||$i == 10 ||$i == 13;# skip BEL, LF, and CR
2222
$dbname =$dbname .sprintf('%c',$i);
2323
}
2424

25-
# Exercise backslashes adjacent to double quotes, a Windows special
26-
# case.
27-
$dbname ='\\"\\' .$dbname .'\\\\"\\\\\\';
25+
$dbname .=$suffix;
2826
$node->command_ok(['createdb',$dbname ]);
2927
}
3028

@@ -79,10 +77,12 @@ sub generate_db
7977
{
8078
# Default is to use pg_regress to set up the old instance.
8179

82-
# Create databases with names covering most ASCII bytes
83-
generate_db($oldnode, 1, 45);
84-
generate_db($oldnode, 46, 90);
85-
generate_db($oldnode, 91, 127);
80+
# Create databases with names covering most ASCII bytes. The
81+
# first name exercises backslashes adjacent to double quotes, a
82+
# Windows special case.
83+
generate_db($oldnode,'regression\\"\\', 1, 45,'\\\\"\\\\\\');
84+
generate_db($oldnode,'regression', 46, 90,'');
85+
generate_db($oldnode,'regression', 91, 127,'');
8686

8787
# Grab any regression options that may be passed down by caller.
8888
my$extra_opts =$ENV{EXTRA_REGRESS_OPTS} ||"";
@@ -99,7 +99,7 @@ sub generate_db
9999

100100
my$rc =
101101
system($ENV{PG_REGRESS}
102-
."$extra_opts"
102+
."$extra_opts"
103103
."--dlpath=\"$dlpath\""
104104
."--bindir="
105105
."--host="
@@ -121,6 +121,7 @@ sub generate_db
121121
print"=== EOF ===\n";
122122
}
123123
}
124+
is($rc, 0,'regression tests pass');
124125
}
125126

126127
# Before dumping, get rid of objects not existing or not supported in later

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp