aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-07-01 07:35:01 +0900
committerMichael Paquier <michael@paquier.xyz>2024-07-01 07:35:01 +0900
commit7dcc6f8e6d7a0eb0ce90802311278723843b4bbd (patch)
treef6ff622f9556f3755e9780c0bc98991ddaa13fdd /src
parent54508209178bc73a497c460bd0ffd1645dceb1a2 (diff)
downloadpostgresql-7dcc6f8e6d7a0eb0ce90802311278723843b4bbd.tar.gz
postgresql-7dcc6f8e6d7a0eb0ce90802311278723843b4bbd.zip
Run pgperltidy
This is required before the creation of a new branch. pgindent is clean, as well as is reformat-dat-files. perltidy version is v20230309, as documented in pgindent's README.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_basebackup/t/040_pg_createsubscriber.pl10
-rw-r--r--src/bin/pg_combinebackup/t/003_timeline.pl3
-rw-r--r--src/bin/pg_combinebackup/t/004_manifest.pl3
-rw-r--r--src/bin/pg_combinebackup/t/005_integrity.pl27
-rw-r--r--src/bin/pg_combinebackup/t/006_db_file_copy.pl3
-rw-r--r--src/bin/pg_rewind/t/003_extrafiles.pl4
-rw-r--r--src/bin/pg_verifybackup/t/003_corruption.pl4
-rw-r--r--src/test/recovery/t/009_twophase.pl20
8 files changed, 50 insertions, 24 deletions
diff --git a/src/bin/pg_basebackup/t/040_pg_createsubscriber.pl b/src/bin/pg_basebackup/t/040_pg_createsubscriber.pl
index 9e2d838503e..8e8d3f0a02a 100644
--- a/src/bin/pg_basebackup/t/040_pg_createsubscriber.pl
+++ b/src/bin/pg_basebackup/t/040_pg_createsubscriber.pl
@@ -289,10 +289,13 @@ $node_p->restart;
# Create failover slot to test its removal
my $fslotname = 'failover_slot';
$node_p->safe_psql($db1,
- "SELECT pg_create_logical_replication_slot('$fslotname', 'pgoutput', false, false, true)");
+ "SELECT pg_create_logical_replication_slot('$fslotname', 'pgoutput', false, false, true)"
+);
$node_s->start;
$node_s->safe_psql('postgres', "SELECT pg_sync_replication_slots()");
-my $result = $node_s->safe_psql('postgres', "SELECT slot_name FROM pg_replication_slots WHERE slot_name = '$fslotname' AND synced AND NOT temporary");
+my $result = $node_s->safe_psql('postgres',
+ "SELECT slot_name FROM pg_replication_slots WHERE slot_name = '$fslotname' AND synced AND NOT temporary"
+);
is($result, 'failover_slot', 'failover slot is synced');
$node_s->stop;
@@ -381,7 +384,8 @@ $node_s->wait_for_subscription_sync($node_p, $subnames[1]);
# Confirm the failover slot has been removed
$result = $node_s->safe_psql($db1,
- "SELECT count(*) FROM pg_replication_slots WHERE slot_name = '$fslotname'");
+ "SELECT count(*) FROM pg_replication_slots WHERE slot_name = '$fslotname'"
+);
is($result, qq(0), 'failover slot was removed');
# Check result on database $db1
diff --git a/src/bin/pg_combinebackup/t/003_timeline.pl b/src/bin/pg_combinebackup/t/003_timeline.pl
index 83ab674a244..b9c67341ad8 100644
--- a/src/bin/pg_combinebackup/t/003_timeline.pl
+++ b/src/bin/pg_combinebackup/t/003_timeline.pl
@@ -72,7 +72,8 @@ $node2->command_ok(
# Restore the incremental backup and use it to create a new node.
my $node3 = PostgreSQL::Test::Cluster->new('node3');
-$node3->init_from_backup($node1, 'backup3',
+$node3->init_from_backup(
+ $node1, 'backup3',
combine_with_prior => [ 'backup1', 'backup2' ],
combine_mode => $mode);
$node3->start();
diff --git a/src/bin/pg_combinebackup/t/004_manifest.pl b/src/bin/pg_combinebackup/t/004_manifest.pl
index 6d475163ab9..9b09ae2641d 100644
--- a/src/bin/pg_combinebackup/t/004_manifest.pl
+++ b/src/bin/pg_combinebackup/t/004_manifest.pl
@@ -58,7 +58,8 @@ sub combine_and_test_one_backup
combine_and_test_one_backup('nomanifest',
qr/could not open file.*backup_manifest/,
'--no-manifest');
-combine_and_test_one_backup('csum_none', undef, '--manifest-checksums=NONE', $mode);
+combine_and_test_one_backup('csum_none', undef, '--manifest-checksums=NONE',
+ $mode);
combine_and_test_one_backup('csum_sha224',
undef, '--manifest-checksums=SHA224', $mode);
diff --git a/src/bin/pg_combinebackup/t/005_integrity.pl b/src/bin/pg_combinebackup/t/005_integrity.pl
index 3caed13f6ed..25ebb8c0406 100644
--- a/src/bin/pg_combinebackup/t/005_integrity.pl
+++ b/src/bin/pg_combinebackup/t/005_integrity.pl
@@ -84,13 +84,19 @@ my $resultpath = $node1->backup_dir . '/result';
# Can't combine 2 full backups.
$node1->command_fails_like(
- [ 'pg_combinebackup', $backup1path, $backup1path, '-o', $resultpath, $mode ],
+ [
+ 'pg_combinebackup', $backup1path, $backup1path, '-o',
+ $resultpath, $mode
+ ],
qr/is a full backup, but only the first backup should be a full backup/,
"can't combine full backups");
# Can't combine 2 incremental backups.
$node1->command_fails_like(
- [ 'pg_combinebackup', $backup2path, $backup2path, '-o', $resultpath, $mode ],
+ [
+ 'pg_combinebackup', $backup2path, $backup2path, '-o',
+ $resultpath, $mode
+ ],
qr/is an incremental backup, but the first backup should be a full backup/,
"can't combine full backups");
@@ -121,7 +127,10 @@ move("$backup2path/backup_manifest.orig", "$backup2path/backup_manifest")
# Can't omit a required backup.
$node1->command_fails_like(
- [ 'pg_combinebackup', $backup1path, $backup3path, '-o', $resultpath, $mode ],
+ [
+ 'pg_combinebackup', $backup1path, $backup3path, '-o',
+ $resultpath, $mode
+ ],
qr/starts at LSN.*but expected/,
"can't omit a required backup");
@@ -154,13 +163,21 @@ $node1->command_ok(
# Can combine result of previous step with second incremental.
$node1->command_ok(
- [ 'pg_combinebackup', $synthetic12path, $backup3path, '-o', $resultpath, $mode ],
+ [
+ 'pg_combinebackup', $synthetic12path,
+ $backup3path, '-o',
+ $resultpath, $mode
+ ],
"can combine synthetic backup with later incremental");
rmtree($resultpath);
# Can't combine result of 1+2 with 2.
$node1->command_fails_like(
- [ 'pg_combinebackup', $synthetic12path, $backup2path, '-o', $resultpath, $mode ],
+ [
+ 'pg_combinebackup', $synthetic12path,
+ $backup2path, '-o',
+ $resultpath, $mode
+ ],
qr/starts at LSN.*but expected/,
"can't combine synthetic backup with included incremental");
diff --git a/src/bin/pg_combinebackup/t/006_db_file_copy.pl b/src/bin/pg_combinebackup/t/006_db_file_copy.pl
index f44788e82bf..60bdc8d00f7 100644
--- a/src/bin/pg_combinebackup/t/006_db_file_copy.pl
+++ b/src/bin/pg_combinebackup/t/006_db_file_copy.pl
@@ -49,7 +49,8 @@ $primary->command_ok(
# Recover the incremental backup.
my $restore = PostgreSQL::Test::Cluster->new('restore');
-$restore->init_from_backup($primary, 'backup2',
+$restore->init_from_backup(
+ $primary, 'backup2',
combine_with_prior => ['backup1'],
combine_mode => $mode);
$restore->start();
diff --git a/src/bin/pg_rewind/t/003_extrafiles.pl b/src/bin/pg_rewind/t/003_extrafiles.pl
index 5ddc61aa5a0..097b0fde9d9 100644
--- a/src/bin/pg_rewind/t/003_extrafiles.pl
+++ b/src/bin/pg_rewind/t/003_extrafiles.pl
@@ -55,8 +55,8 @@ sub run_test
"$test_standby_datadir/tst_standby_dir/standby_subdir/standby_file4",
"in standby4";
# Skip testing .DS_Store files on macOS to avoid risk of side effects
- append_to_file
- "$test_standby_datadir/tst_standby_dir/.DS_Store", "macOS system file"
+ append_to_file "$test_standby_datadir/tst_standby_dir/.DS_Store",
+ "macOS system file"
unless ($Config{osname} eq 'darwin');
mkdir "$test_primary_datadir/tst_primary_dir";
diff --git a/src/bin/pg_verifybackup/t/003_corruption.pl b/src/bin/pg_verifybackup/t/003_corruption.pl
index fac823e9ce1..ae91e043384 100644
--- a/src/bin/pg_verifybackup/t/003_corruption.pl
+++ b/src/bin/pg_verifybackup/t/003_corruption.pl
@@ -108,8 +108,8 @@ for my $scenario (@scenario)
SKIP:
{
skip "unix-style permissions not supported on Windows", 4
- if ($scenario->{'skip_on_windows'} &&
- ($windows_os || $Config::Config{osname} eq 'cygwin'));
+ if ($scenario->{'skip_on_windows'}
+ && ($windows_os || $Config::Config{osname} eq 'cygwin'));
# Take a backup and check that it verifies OK.
my $backup_path = $primary->backup_dir . '/' . $name;
diff --git a/src/test/recovery/t/009_twophase.pl b/src/test/recovery/t/009_twophase.pl
index 21a65cd298b..12c2f0e40d1 100644
--- a/src/test/recovery/t/009_twophase.pl
+++ b/src/test/recovery/t/009_twophase.pl
@@ -330,32 +330,34 @@ $cur_primary->stop;
$cur_standby->restart;
# Acquire a snapshot in standby, before we commit the prepared transaction
-my $standby_session = $cur_standby->background_psql('postgres', on_error_die => 1);
+my $standby_session =
+ $cur_standby->background_psql('postgres', on_error_die => 1);
$standby_session->query_safe("BEGIN ISOLATION LEVEL REPEATABLE READ");
-$psql_out = $standby_session->query_safe(
- "SELECT count(*) FROM t_009_tbl_standby_mvcc");
+$psql_out =
+ $standby_session->query_safe("SELECT count(*) FROM t_009_tbl_standby_mvcc");
is($psql_out, '0',
"Prepared transaction not visible in standby before commit");
# Commit the transaction in primary
$cur_primary->start;
-$cur_primary->psql('postgres', "
+$cur_primary->psql(
+ 'postgres', "
SET synchronous_commit='remote_apply'; -- To ensure the standby is caught up
COMMIT PREPARED 'xact_009_standby_mvcc';
");
# Still not visible to the old snapshot
-$psql_out = $standby_session->query_safe(
- "SELECT count(*) FROM t_009_tbl_standby_mvcc");
+$psql_out =
+ $standby_session->query_safe("SELECT count(*) FROM t_009_tbl_standby_mvcc");
is($psql_out, '0',
"Committed prepared transaction not visible to old snapshot in standby");
# Is visible to a new snapshot
$standby_session->query_safe("COMMIT");
-$psql_out = $standby_session->query_safe(
- "SELECT count(*) FROM t_009_tbl_standby_mvcc");
+$psql_out =
+ $standby_session->query_safe("SELECT count(*) FROM t_009_tbl_standby_mvcc");
is($psql_out, '2',
- "Committed prepared transaction is visible to new snapshot in standby");
+ "Committed prepared transaction is visible to new snapshot in standby");
$standby_session->quit;
###############################################################################