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

Commitbe31ac2

Browse files
committed
Run perltidy
A follow-up patch will adjust the TAP tests to follow a more-structuredformat for option lists in commands, that perltidy is able to copebetter with. Putting the tree first in a clean state makes the nextchange a bit easier. v20230309 has been used.Author: Dagfinn Ilmari MannsåkerDiscussion:https://postgr.es/m/87jzc46d8u.fsf@wibble.ilmari.org
1 parent4907ba3 commitbe31ac2

File tree

14 files changed

+63
-46
lines changed

14 files changed

+63
-46
lines changed

‎src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@
364364
# drives.
365365
rmdir("$pgdata/pg_replslot")
366366
or BAIL_OUT"could not remove$pgdata/pg_replslot";
367-
mkdir("$sys_tempdir/pg_replslot");# if this fails the symlink will fail
367+
mkdir("$sys_tempdir/pg_replslot");# if this fails the symlink will fail
368368
dir_symlink("$sys_tempdir/pg_replslot","$pgdata/pg_replslot")
369369
or BAIL_OUT"could not symlink to$pgdata/pg_replslot";
370370

‎src/bin/pg_combinebackup/t/008_promote.pl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
$node2->start();
5656

5757
# Wait until recovery pauses, then promote.
58-
$node2->poll_query_until('postgres',"SELECT pg_get_wal_replay_pause_state() = 'paused';");
58+
$node2->poll_query_until('postgres',
59+
"SELECT pg_get_wal_replay_pause_state() = 'paused';");
5960
$node2->safe_psql('postgres',"SELECT pg_promote()");
6061

6162
# Once promotion occurs, insert a second row on the new node.
@@ -68,14 +69,16 @@
6869
# timeline change correctly, something should break at this point.
6970
my$backup2path =$node1->backup_dir .'/backup2';
7071
$node2->command_ok(
71-
['pg_basebackup','-D',$backup2path,'--no-sync','-cfast',
72-
'--incremental',$backup1path .'/backup_manifest' ],
72+
[
73+
'pg_basebackup','-D',$backup2path,'--no-sync','-cfast',
74+
'--incremental',$backup1path .'/backup_manifest'
75+
],
7376
"incremental backup from node2");
7477

7578
# Restore the incremental backup and use it to create a new node.
7679
my$node3 = PostgreSQL::Test::Cluster->new('node3');
7780
$node3->init_from_backup($node1,'backup2',
78-
combine_with_prior=> ['backup1']);
81+
combine_with_prior=> ['backup1']);
7982
$node3->start();
8083

8184
done_testing();

‎src/bin/pg_combinebackup/t/009_no_full_file.pl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
if (-f"$backup1path/base/1/$name")
4747
{
4848
copy("$backup2path/base/1/$iname","$backup1path/base/1/$iname")
49-
||die"copy$backup2path/base/1/$iname:$!";
49+
||die"copy$backup2path/base/1/$iname:$!";
5050
unlink("$backup1path/base/1/$name")
51-
||die"unlink$backup1path/base/1/$name:$!";
51+
||die"unlink$backup1path/base/1/$name:$!";
5252
$success = 1;
5353
last;
5454
}
@@ -57,9 +57,7 @@
5757
# pg_combinebackup should fail.
5858
my$outpath =$primary->backup_dir .'/out';
5959
$primary->command_fails_like(
60-
[
61-
'pg_combinebackup',$backup1path,$backup2path,'-o',$outpath,
62-
],
60+
['pg_combinebackup',$backup1path,$backup2path,'-o',$outpath, ],
6361
qr/full backup contains unexpected incremental file/,
6462
"pg_combinebackup fails");
6563

‎src/bin/pg_verifybackup/t/002_algorithm.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ sub test_checksums
4242
}
4343

4444
# A backup with a valid algorithm should work.
45-
$primary->command_ok(\@backup,"$format format backup ok with algorithm\"$algorithm\"");
45+
$primary->command_ok(\@backup,
46+
"$format format backup ok with algorithm\"$algorithm\"");
4647

4748
# We expect each real checksum algorithm to be mentioned on every line of
4849
# the backup manifest file except the first and last; for simplicity, we
4950
# just check that it shows up lots of times. When the checksum algorithm
5051
# is none, we just check that the manifest exists.
5152
if ($algorithmeq'none')
5253
{
53-
ok(-f"$backup_path/backup_manifest","$format format backup manifest exists");
54+
ok(-f"$backup_path/backup_manifest",
55+
"$format format backup manifest exists");
5456
}
5557
else
5658
{

‎src/bin/pg_verifybackup/t/003_corruption.pl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@
6060
{
6161
'name'=>'append_to_file',
6262
'mutilate'=> \&mutilate_append_to_file,
63-
'fails_like'=>qr/has size\d+ (on disk|in "[^"]+") but size\d+ in the manifest/
63+
'fails_like'=>
64+
qr/has size\d+ (on disk|in "[^"]+") but size\d+ in the manifest/
6465
},
6566
{
6667
'name'=>'truncate_file',
6768
'mutilate'=> \&mutilate_truncate_file,
68-
'fails_like'=>qr/has size 0 (on disk|in "[^"]+") but size\d+ in the manifest/
69+
'fails_like'=>
70+
qr/has size 0 (on disk|in "[^"]+") but size\d+ in the manifest/
6971
},
7072
{
7173
'name'=>'replace_file',
@@ -147,23 +149,25 @@
147149
# same problem, unless the scenario needs UNIX permissions or we don't
148150
# have a TAR program available. Note that this destructively modifies
149151
# the backup directory.
150-
if (!$scenario->{'needs_unix_permissions'} ||
151-
!defined$tar ||$tareq'')
152+
if ( !$scenario->{'needs_unix_permissions'}
153+
|| !defined$tar
154+
||$tareq'')
152155
{
153156
my$tar_backup_path =$primary->backup_dir .'/tar_' .$name;
154157
mkdir($tar_backup_path) ||die"mkdir$tar_backup_path:$!";
155158

156159
# tar and then remove each tablespace. We remove the original files
157160
# so that they don't also end up in base.tar.
158161
my@tsoid =grep {$_ne'.' &&$_ne'..' }
159-
slurp_dir("$backup_path/pg_tblspc");
162+
slurp_dir("$backup_path/pg_tblspc");
160163
my$cwd = getcwd;
161164
formy$tsoid (@tsoid)
162165
{
163166
my$tspath =$backup_path .'/pg_tblspc/' .$tsoid;
164167

165168
chdir($tspath) ||die"chdir:$!";
166-
command_ok([$tar,'-cf',"$tar_backup_path/$tsoid.tar",'.' ]);
169+
command_ok(
170+
[$tar,'-cf',"$tar_backup_path/$tsoid.tar",'.' ]);
167171
chdir($cwd) ||die"chdir:$!";
168172
rmtree($tspath);
169173
}
@@ -175,9 +179,10 @@
175179
rmtree($backup_path .'/pg_wal');
176180

177181
# move the backup manifest
178-
move($backup_path .'/backup_manifest',
179-
$tar_backup_path .'/backup_manifest')
180-
ordie"could not copy manifest to$tar_backup_path";
182+
move(
183+
$backup_path .'/backup_manifest',
184+
$tar_backup_path .'/backup_manifest'
185+
)ordie"could not copy manifest to$tar_backup_path";
181186

182187
# Construct base.tar with what's left.
183188
chdir($backup_path) ||die"chdir:$!";

‎src/bin/pg_verifybackup/t/004_options.pl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
is($stderr,'',"-q succeeds: no stderr");
3030

3131
# Should still work if we specify -Fp.
32-
$primary->command_ok(
33-
['pg_verifybackup','-Fp',$backup_path ],
32+
$primary->command_ok(['pg_verifybackup','-Fp',$backup_path ],
3433
"verifies with -Fp");
3534

3635
# Should not work if we specify -Fy because that's invalid.

‎src/bin/pg_verifybackup/t/008_untar.pl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
my$source_ts_path = PostgreSQL::Test::Utils::tempdir_short();
2121

2222
# Create a tablespace with table in it.
23-
$primary->safe_psql('postgres',qq(
23+
$primary->safe_psql(
24+
'postgres',qq(
2425
CREATE TABLESPACE regress_ts1 LOCATION '$source_ts_path';
2526
SELECT oid FROM pg_tablespace WHERE spcname = 'regress_ts1';
2627
CREATE TABLE regress_tbl1(i int) TABLESPACE regress_ts1;
2728
INSERT INTO regress_tbl1 VALUES(generate_series(1,5));));
28-
my$tsoid =$primary->safe_psql('postgres',qq(
29+
my$tsoid =$primary->safe_psql(
30+
'postgres',qq(
2931
SELECT oid FROM pg_tablespace WHERE spcname = 'regress_ts1'));
3032

3133
my$backup_path =$primary->backup_dir .'/server-backup';
@@ -35,7 +37,7 @@
3537
{
3638
'compression_method'=>'none',
3739
'backup_flags'=> [],
38-
'backup_archive'=> ['base.tar',"$tsoid.tar"],
40+
'backup_archive'=> ['base.tar',"$tsoid.tar"],
3941
'enabled'=> 1
4042
},
4143
{
@@ -47,7 +49,7 @@
4749
{
4850
'compression_method'=>'lz4',
4951
'backup_flags'=> ['--compress','server-lz4' ],
50-
'backup_archive'=> ['base.tar.lz4',"$tsoid.tar.lz4" ],
52+
'backup_archive'=> ['base.tar.lz4',"$tsoid.tar.lz4" ],
5153
'enabled'=> check_pg_config("#define USE_LZ4 1")
5254
},
5355
{
@@ -95,7 +97,7 @@
9597
"found expected backup files, compression$method");
9698

9799
# Verify tar backup.
98-
$primary->command_ok(['pg_verifybackup','-n','-e',$backup_path],
100+
$primary->command_ok(['pg_verifybackup','-n','-e',$backup_path],
99101
"verify backup, compression$method");
100102

101103
# Cleanup.

‎src/bin/pg_verifybackup/t/010_client_untar.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"found expected backup files, compression$method");
109109

110110
# Verify tar backup.
111-
$primary->command_ok(['pg_verifybackup','-n','-e',$backup_path ],
111+
$primary->command_ok(['pg_verifybackup','-n','-e',$backup_path ],
112112
"verify backup, compression$method");
113113

114114
# Cleanup.

‎src/test/perl/PostgreSQL/Test/Cluster.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,8 @@ sub stop
12141214

12151215
print"### Stopping node\"$name\" using mode$mode\n";
12161216
my@cmd = ('pg_ctl','-D',$pgdata,'-m',$mode,'stop');
1217-
if ($params{timeout}) {
1217+
if ($params{timeout})
1218+
{
12181219
push(@cmd, ('--timeout',$params{timeout}));
12191220
}
12201221
$ret = PostgreSQL::Test::Utils::system_log(@cmd);

‎src/test/recovery/t/035_standby_logical_decoding.pl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -529,12 +529,14 @@ sub wait_until_vacuum_can_remove
529529

530530
# Attempting to alter an invalidated slot should result in an error
531531
($result,$stdout,$stderr) =$node_standby->psql(
532-
'postgres',
533-
qq[ALTER_REPLICATION_SLOT vacuum_full_inactiveslot (failover);],
534-
replication=>'database');
535-
ok($stderr =~/ERROR: cannot alter invalid replication slot "vacuum_full_inactiveslot"/ &&
536-
$stderr =~/DETAIL: This replication slot has been invalidated due to "rows_removed"./,
537-
"invalidated slot cannot be altered");
532+
'postgres',
533+
qq[ALTER_REPLICATION_SLOT vacuum_full_inactiveslot (failover);],
534+
replication=>'database');
535+
ok($stderr =~
536+
/ERROR: cannot alter invalid replication slot "vacuum_full_inactiveslot"/
537+
&&$stderr =~
538+
/DETAIL: This replication slot has been invalidated due to "rows_removed"./,
539+
"invalidated slot cannot be altered");
538540

539541
# Ensure that replication slot stats are not removed after invalidation.
540542
is($node_standby->safe_psql(

‎src/test/recovery/t/040_standby_failover_slots_sync.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@
9595
# Disable failover for enabled subscription
9696
my ($result,$stdout,$stderr) =$subscriber1->psql('postgres',
9797
"ALTER SUBSCRIPTION regress_mysub1 SET (failover = false)");
98-
ok($stderr =~/ERROR: cannot set option "failover" for enabled subscription/,
98+
ok($stderr =~
99+
/ERROR: cannot set option "failover" for enabled subscription/,
99100
"altering failover is not allowed for enabled subscription");
100101

101102
##################################################
@@ -280,7 +281,8 @@
280281

281282
# Confirm that the invalidated slot has been dropped.
282283
$standby1->wait_for_log(
283-
qr/dropped replication slot "lsub1_slot" of database with OID [0-9]+/,$log_offset);
284+
qr/dropped replication slot "lsub1_slot" of database with OID [0-9]+/,
285+
$log_offset);
284286

285287
# Confirm that the logical slot has been re-created on the standby and is
286288
# flagged as 'synced'

‎src/test/ssl/t/SSL/Server.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ sub switch_server_cert
302302
$node->append_conf('sslconfig.conf',$backend->set_server_cert(\%params));
303303
# use lists of ECDH curves and cipher suites for syntax testing
304304
$node->append_conf('sslconfig.conf','ssl_groups=prime256v1:secp521r1');
305-
$node->append_conf('sslconfig.conf','ssl_tls13_ciphers=TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256');
305+
$node->append_conf('sslconfig.conf',
306+
'ssl_tls13_ciphers=TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256');
306307

307308
$node->append_conf('sslconfig.conf',
308309
"ssl_passphrase_command='" .$params{passphrase_cmd} ."'")

‎src/tools/add_commit_links.pl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ sub process_file
6262

6363
# skip over commit links because we will add them below
6464
next
65-
if (!$in_comment &&
66-
m{^\s*<ulink url="&commit_baseurl;[[:xdigit:]]+">&sect;</ulink>\s*$});
65+
if (!$in_comment
66+
&&m{^\s*<ulink url="&commit_baseurl;[[:xdigit:]]+">&sect;</ulink>\s*$}
67+
);
6768

6869
if ($in_comment &&m/\[([[:xdigit:]]+)\]/)
6970
{
@@ -73,10 +74,10 @@ sub process_file
7374
(!m/^Branch:/) &&push(@hashes,$hash);
7475

7576
# minor release item
76-
m/^Branch:/ &&
77-
defined($major_version) &&
78-
m/_${major_version}_/ &&
79-
push(@hashes,$hash);
77+
m/^Branch:/
78+
&&defined($major_version)
79+
&&m/_${major_version}_/
80+
&&push(@hashes,$hash);
8081
}
8182

8283
if (!$in_comment &&m{</para>})

‎src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
],
5050
"pg_bsd_indent succeeds on$test");
5151
# check result matches, adding any diff to $diffs_file
52-
my$result = run_log(['diff',@diffopts,"$test_src.stdout","$test.out" ],
52+
my$result =
53+
run_log(['diff',@diffopts,"$test_src.stdout","$test.out" ],
5354
'>>',$diffs_file);
5455
ok($result,"pg_bsd_indent output matches for$test");
5556
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp