Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 11d0677

Browse files
knizhnikkelvich
authored andcommitted
Fix bug in handling tables without primary key
1 parent d4bcc33 commit 11d0677

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

multimaster.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,15 +2395,18 @@ MtmExecutorFinish(QueryDesc *queryDesc)
23952395
for (i = 0; i < estate->es_num_result_relations; i++) {
23962396
Relation rel = estate->es_result_relations[i].ri_RelationDesc;
23972397
if (RelationNeedsWAL(rel)) {
2398+
if (MtmIgnoreTablesWithoutPk) {
2399+
if (!rel->rd_indexvalid) {
2400+
RelationGetIndexList(rel);
2401+
}
2402+
if (rel->rd_replidindex == InvalidOid) {
2403+
MtmMakeRelationLocal(RelationGetRelid(rel));
2404+
continue;
2405+
}
2406+
}
23982407
MtmTx.containsDML = true;
23992408
break;
24002409
}
2401-
if (MtmIgnoreTablesWithoutPk) {
2402-
if (!rel->rd_indexvalid) {
2403-
RelationGetIndexList(rel);
2404-
}
2405-
MtmMakeRelationLocal(rel->rd_replidindex);
2406-
}
24072410
}
24082411
}
24092412
if (MtmTx.isDistributed && MtmTx.containsDML && !IsTransactionBlock()) {

0 commit comments

Comments
 (0)