summaryrefslogtreecommitdiff
path: root/src/test/subscription
diff options
context:
space:
mode:
authorTom Lane2024-05-14 20:34:50 +0000
committerTom Lane2024-05-14 20:34:50 +0000
commitda256a4a7fdcca35fe7ca808686ad3de6ee22306 (patch)
tree863d6a21cd148b40add73ae45bdedcf0acc001ee /src/test/subscription
parent3ddbac368c205fce1f293de1fe60c1b479800746 (diff)
Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files. The pgindent part of this is pretty small, consisting mainly of fixing up self-inflicted formatting damage from patches that hadn't bothered to add their new typedefs to typedefs.list. In order to keep it from making anything worse, I manually added a dozen or so typedefs that appeared in the existing typedefs.list but not in the buildfarm's list. Perhaps we should formalize that, or better find a way to get those typedefs into the automatic list. pgperltidy is as opinionated as always, and reformat-dat-files too.
Diffstat (limited to 'src/test/subscription')
-rw-r--r--src/test/subscription/t/008_diff_schema.pl3
-rw-r--r--src/test/subscription/t/019_stream_subxact_ddl_abort.pl3
-rw-r--r--src/test/subscription/t/026_stats.pl3
-rw-r--r--src/test/subscription/t/029_on_error.pl3
-rw-r--r--src/test/subscription/t/032_subscribe_use_index.pl3
-rw-r--r--src/test/subscription/t/033_run_as_table_owner.pl5
-rw-r--r--src/test/subscription/t/100_bugs.pl15
7 files changed, 17 insertions, 18 deletions
diff --git a/src/test/subscription/t/008_diff_schema.pl b/src/test/subscription/t/008_diff_schema.pl
index a21b9fab5f2..cf04f85584a 100644
--- a/src/test/subscription/t/008_diff_schema.pl
+++ b/src/test/subscription/t/008_diff_schema.pl
@@ -48,7 +48,8 @@ is($result, qq(2|2|2), 'check initial data was copied to subscriber');
# Update the rows on the publisher and check the additional columns on
# subscriber didn't change
-$node_publisher->safe_psql('postgres', "UPDATE test_tab SET b = encode(sha256(b::bytea), 'hex')");
+$node_publisher->safe_psql('postgres',
+ "UPDATE test_tab SET b = encode(sha256(b::bytea), 'hex')");
$node_publisher->wait_for_catchup('tap_sub');
diff --git a/src/test/subscription/t/019_stream_subxact_ddl_abort.pl b/src/test/subscription/t/019_stream_subxact_ddl_abort.pl
index 6f2e4db6ae8..84c0e5ca9ef 100644
--- a/src/test/subscription/t/019_stream_subxact_ddl_abort.pl
+++ b/src/test/subscription/t/019_stream_subxact_ddl_abort.pl
@@ -32,7 +32,8 @@ $node_publisher->safe_psql('postgres',
# Setup structure on subscriber
$node_subscriber->safe_psql('postgres',
- "CREATE TABLE test_tab (a int primary key, b bytea, c INT, d INT, e INT)");
+ "CREATE TABLE test_tab (a int primary key, b bytea, c INT, d INT, e INT)"
+);
# Setup logical replication
my $publisher_connstr = $node_publisher->connstr . ' dbname=postgres';
diff --git a/src/test/subscription/t/026_stats.pl b/src/test/subscription/t/026_stats.pl
index d1d68fad9af..fb3e5629b3c 100644
--- a/src/test/subscription/t/026_stats.pl
+++ b/src/test/subscription/t/026_stats.pl
@@ -288,8 +288,7 @@ is( $node_subscriber->safe_psql(
# Since disabling subscription doesn't wait for walsender to release the replication
# slot and exit, wait for the slot to become inactive.
-$node_publisher->poll_query_until(
- $db,
+$node_publisher->poll_query_until($db,
qq(SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = '$sub2_name' AND active_pid IS NULL))
) or die "slot never became inactive";
diff --git a/src/test/subscription/t/029_on_error.pl b/src/test/subscription/t/029_on_error.pl
index 7a8e424a22e..5c29e5cc326 100644
--- a/src/test/subscription/t/029_on_error.pl
+++ b/src/test/subscription/t/029_on_error.pl
@@ -166,7 +166,8 @@ BEGIN;
INSERT INTO tbl SELECT i, sha256(i::text::bytea) FROM generate_series(1, 10000) s(i);
COMMIT;
]);
-test_skip_lsn($node_publisher, $node_subscriber, "(4, sha256(4::text::bytea))",
+test_skip_lsn($node_publisher, $node_subscriber,
+ "(4, sha256(4::text::bytea))",
"4", "test skipping stream-commit");
$result = $node_subscriber->safe_psql('postgres',
diff --git a/src/test/subscription/t/032_subscribe_use_index.pl b/src/test/subscription/t/032_subscribe_use_index.pl
index 97b5806acf0..cc999e33c3a 100644
--- a/src/test/subscription/t/032_subscribe_use_index.pl
+++ b/src/test/subscription/t/032_subscribe_use_index.pl
@@ -490,7 +490,8 @@ $node_publisher->safe_psql('postgres',
$node_subscriber->safe_psql('postgres',
"CREATE TABLE test_replica_id_full (x int, y text)");
$node_subscriber->safe_psql('postgres',
- "CREATE INDEX test_replica_id_full_idx ON test_replica_id_full USING HASH (x)");
+ "CREATE INDEX test_replica_id_full_idx ON test_replica_id_full USING HASH (x)"
+);
# insert some initial data
$node_publisher->safe_psql('postgres',
diff --git a/src/test/subscription/t/033_run_as_table_owner.pl b/src/test/subscription/t/033_run_as_table_owner.pl
index c56f22881fe..b129fc3c38e 100644
--- a/src/test/subscription/t/033_run_as_table_owner.pl
+++ b/src/test/subscription/t/033_run_as_table_owner.pl
@@ -207,10 +207,7 @@ GRANT regress_alice TO regress_admin WITH INHERIT FALSE, SET TRUE;
# the above grant doesn't help.
publish_insert("alice.unpartitioned", 14);
expect_failure(
- "alice.unpartitioned",
- 3,
- 7,
- 13,
+ "alice.unpartitioned", 3, 7, 13,
qr/ERROR: ( [A-Z0-9]+:)? permission denied for table unpartitioned/msi,
"with no privileges cannot replicate");
diff --git a/src/test/subscription/t/100_bugs.pl b/src/test/subscription/t/100_bugs.pl
index e5d7d37a402..cb36ca7b16b 100644
--- a/src/test/subscription/t/100_bugs.pl
+++ b/src/test/subscription/t/100_bugs.pl
@@ -469,23 +469,22 @@ $node_subscriber->safe_psql(
));
$node_subscriber->wait_for_subscription_sync($node_publisher, 'sub1');
-$result = $node_subscriber->safe_psql('postgres',
- "SELECT a, b FROM tab_default");
-is($result, qq(1|f
+$result =
+ $node_subscriber->safe_psql('postgres', "SELECT a, b FROM tab_default");
+is( $result, qq(1|f
2|t), 'check snapshot on subscriber');
# Update all rows in the table and ensure the rows with the missing `b`
# attribute replicate correctly.
-$node_publisher->safe_psql('postgres',
- "UPDATE tab_default SET a = a + 1");
+$node_publisher->safe_psql('postgres', "UPDATE tab_default SET a = a + 1");
$node_publisher->wait_for_catchup('sub1');
# When the bug is present, the `1|f` row will not be updated to `2|f` because
# the publisher incorrectly fills in `NULL` for `b` and publishes an update
# for `1|NULL`, which doesn't exist in the subscriber.
-$result = $node_subscriber->safe_psql('postgres',
- "SELECT a, b FROM tab_default");
-is($result, qq(2|f
+$result =
+ $node_subscriber->safe_psql('postgres', "SELECT a, b FROM tab_default");
+is( $result, qq(2|f
3|t), 'check replicated update on subscriber');
$node_publisher->stop('fast');