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

Commitfca17a9

Browse files
committed
Fix local/remote attribute mix-up in logical replication
This would lead to failures if local and remote tables have a differentcolumn order. The tests previously didn't catch that because they onlytested the initial data copy. So add another test that exercises theapply worker.Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
1 parent0e58455 commitfca17a9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎src/backend/replication/logical/worker.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ slot_modify_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
402402
errarg.attnum=remoteattnum;
403403

404404
getTypeInputInfo(att->atttypid,&typinput,&typioparam);
405-
slot->tts_values[i]=OidInputFunctionCall(typinput,values[i],
405+
slot->tts_values[i]=OidInputFunctionCall(typinput,
406+
values[remoteattnum],
406407
typioparam,
407408
att->atttypmod);
408409
slot->tts_isnull[i]= false;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
$node_publisher->safe_psql('postgres',"DELETE FROM tab_rep WHERE a > 20");
9090
$node_publisher->safe_psql('postgres',"UPDATE tab_rep SET a = -a");
9191

92+
$node_publisher->safe_psql('postgres',"INSERT INTO tab_mixed VALUES (2, 'bar')");
93+
9294
$node_publisher->poll_query_until('postgres',$caughtup_query)
9395
ordie"Timed out while waiting for subscriber to catch up";
9496

@@ -102,7 +104,8 @@
102104

103105
$result =$node_subscriber->safe_psql('postgres',
104106
"SELECT c, b, a FROM tab_mixed");
105-
is($result,qq(|foo|1),'check replicated changes with different column order');
107+
is($result,qq(|foo|1
108+
|bar|2),'check replicated changes with different column order');
106109

107110
# insert some duplicate rows
108111
$node_publisher->safe_psql('postgres',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp