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

Commitfdbeae3

Browse files
committed
Detect and replicate lo_create() calls
1 parent10b4690 commitfdbeae3

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

‎contrib/mmts/multimaster.c‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,14 @@ static int MtmGcPeriod;
229229
staticboolMtmIgnoreTablesWithoutPk;
230230
staticintMtmLockCount;
231231

232+
staticExecutorStart_hook_typePreviousExecutorStartHook;
232233
staticExecutorFinish_hook_typePreviousExecutorFinishHook;
233234
staticProcessUtility_hook_typePreviousProcessUtilityHook;
234235
staticshmem_startup_hook_typePreviousShmemStartupHook;
235236

236237
staticnodemask_tlastKnownMatrix[MAX_NODES];
237238

239+
staticvoidMtmExecutorStart(QueryDesc*queryDesc,inteflags);
238240
staticvoidMtmExecutorFinish(QueryDesc*queryDesc);
239241
staticvoidMtmProcessUtility(Node*parsetree,constchar*queryString,
240242
ProcessUtilityContextcontext,ParamListInfoparams,
@@ -2675,6 +2677,9 @@ _PG_init(void)
26752677
PreviousShmemStartupHook=shmem_startup_hook;
26762678
shmem_startup_hook=MtmShmemStartup;
26772679

2680+
PreviousExecutorStartHook=ExecutorStart_hook;
2681+
ExecutorStart_hook=MtmExecutorStart;
2682+
26782683
PreviousExecutorFinishHook=ExecutorFinish_hook;
26792684
ExecutorFinish_hook=MtmExecutorFinish;
26802685

@@ -3973,12 +3978,34 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
39733978
MtmTx.snapshot=INVALID_CSN;
39743979
}
39753980

3976-
if (executed&& !skipCommand)
3981+
if (executed)
39773982
{
39783983
MtmFinishDDLCommand();
39793984
}
39803985
}
39813986

3987+
staticvoid
3988+
MtmExecutorStart(QueryDesc*queryDesc,inteflags)
3989+
{
3990+
boolddl_generating_call= false;
3991+
ListCell*tlist;
3992+
3993+
foreach(tlist,queryDesc->plannedstmt->planTree->targetlist)
3994+
{
3995+
TargetEntry*tle= (TargetEntry*)lfirst(tlist);
3996+
3997+
if (tle->resname&&strcmp(tle->resname,"lo_create")==0)
3998+
ddl_generating_call= true;
3999+
}
4000+
4001+
if (ddl_generating_call)
4002+
MtmProcessDDLCommand(ActivePortal->sourceText, true);
4003+
4004+
if (PreviousExecutorStartHook!=NULL)
4005+
PreviousExecutorStartHook(queryDesc,eflags);
4006+
else
4007+
standard_ExecutorStart(queryDesc,eflags);
4008+
}
39824009

39834010
staticvoid
39844011
MtmExecutorFinish(QueryDesc*queryDesc)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp