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

Commit785206a

Browse files
committed
Add test coverage for "unchanged toast column" replication code path.
It seems pretty unacceptable to have no regression test coveragefor this aspect of the logical replication protocol, especiallygiven the bugs we've found in related code.Discussion:https://postgr.es/m/16129-a0c0f48e71741e5f@postgresql.org
1 parentb72a44c commit785206a

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

‎src/test/subscription/t/001_rep_changes.pl

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use warnings;
44
use PostgresNode;
55
use TestLib;
6-
use Test::Moretests=>20;
6+
use Test::Moretests=>22;
77

88
# Initialize publisher node
99
my$node_publisher = get_new_node('publisher');
@@ -169,9 +169,38 @@
169169
local|2.2|bar|2),
170170
'update works with different column order and subscriber local values');
171171

172+
# check behavior with toasted values
173+
174+
$node_publisher->safe_psql('postgres',
175+
"UPDATE tab_mixed SET b = repeat('xyzzy', 100000) WHERE a = 2");
176+
177+
$node_publisher->wait_for_catchup($appname);
178+
179+
$result =$node_subscriber->safe_psql('postgres',
180+
"SELECT a, length(b), c, d FROM tab_mixed ORDER BY a");
181+
is($result,qq(1|3|1.1|local
182+
2|500000|2.2|local),
183+
'update transmits large column value');
184+
185+
$node_publisher->safe_psql('postgres',
186+
"UPDATE tab_mixed SET c = 3.3 WHERE a = 2");
187+
188+
$node_publisher->wait_for_catchup($appname);
189+
190+
$result =$node_subscriber->safe_psql('postgres',
191+
"SELECT a, length(b), c, d FROM tab_mixed ORDER BY a");
192+
is($result,qq(1|3|1.1|local
193+
2|500000|3.3|local),
194+
'update with non-transmitted large column value');
195+
172196
# check behavior with dropped columns
173197

198+
# this update should get transmitted before the column goes away
199+
$node_publisher->safe_psql('postgres',
200+
"UPDATE tab_mixed SET b = 'bar', c = 2.2 WHERE a = 2");
201+
174202
$node_publisher->safe_psql('postgres',"ALTER TABLE tab_mixed DROP COLUMN b");
203+
175204
$node_publisher->safe_psql('postgres',
176205
"UPDATE tab_mixed SET c = 11.11 WHERE a = 1");
177206

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp