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

Commit34f64ad

Browse files
knizhnikkelvich
authored andcommitted
Fix PGPPRO-717 correctly restore name/schema of local tables
1 parent1939014 commit34f64ad

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

‎multimaster.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,7 +2523,7 @@ MtmCreateLocalTableMap(void)
25232523
returnhtab;
25242524
}
25252525

2526-
voidMtmMakeRelationLocal(Oidrelid)
2526+
staticvoidMtmMakeRelationLocal(Oidrelid)
25272527
{
25282528
if (OidIsValid(relid)) {
25292529
MtmLock(LW_EXCLUSIVE);
@@ -2533,17 +2533,17 @@ void MtmMakeRelationLocal(Oid relid)
25332533
}
25342534

25352535

2536-
staticvoidMtmMakeTableLocal(char*schema,char*name)
2536+
voidMtmMakeTableLocal(charconst*schema,charconst*name)
25372537
{
2538-
RangeVar*rv=makeRangeVar(schema,name,-1);
2538+
RangeVar*rv=makeRangeVar((char*)schema,(char*)name,-1);
25392539
Oidrelid=RangeVarGetRelid(rv,NoLock, true);
25402540
MtmMakeRelationLocal(relid);
25412541
}
25422542

25432543

25442544
typedefstruct {
2545-
NameDataschema;
2546-
NameDataname;
2545+
textschema;
2546+
textname;
25472547
}MtmLocalTablesTuple;
25482548

25492549
staticvoidMtmLoadLocalTables(void)
@@ -2563,7 +2563,7 @@ static void MtmLoadLocalTables(void)
25632563
while (HeapTupleIsValid(tuple=systable_getnext(scan)))
25642564
{
25652565
MtmLocalTablesTuple*t= (MtmLocalTablesTuple*)GETSTRUCT(tuple);
2566-
MtmMakeTableLocal(NameStr(t->schema),NameStr(t->name));
2566+
MtmMakeTableLocal(text_to_cstring(&t->schema),text_to_cstring(&t->name));
25672567
}
25682568

25692569
systable_endscan(scan);

‎multimaster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ extern void MtmCheckQuorum(void);
404404
externboolMtmRecoveryCaughtUp(intnodeId,lsn_twalEndPtr);
405405
externvoidMtmCheckRecoveryCaughtUp(intnodeId,lsn_tslotLSN);
406406
externvoidMtmRecoveryCompleted(void);
407-
externvoidMtmMakeRelationLocal(Oidrelid);
407+
externvoidMtmMakeTableLocal(charconst*schema,charconst*name);
408408
externvoidMtmHandleApplyError(void);
409409
externvoidMtmUpdateLsnMapping(intnodeId,lsn_tendLsn);
410410
externlsn_tMtmGetFlushPosition(intnodeId);

‎pglogical_apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ process_remote_insert(StringInfo s, Relation rel)
860860
if (strcmp(RelationGetRelationName(rel),MULTIMASTER_LOCAL_TABLES_TABLE)==0&&
861861
strcmp(get_namespace_name(RelationGetNamespace(rel)),MULTIMASTER_SCHEMA_NAME)==0)
862862
{
863-
MtmMakeRelationLocal(RelationGetRelid(rel));
863+
MtmMakeTableLocal(TextDatumGetCString(new_tuple.values[0]),TextDatumGetCString(new_tuple.values[1]));
864864
}
865865

866866
ExecResetTupleTable(estate->es_tupleTable, true);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp