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

Commit0252391

Browse files
committed
Detect and replicate lo_create() calls
1 parentf22016c commit0252391

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

‎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,
@@ -2681,6 +2683,9 @@ _PG_init(void)
26812683
PreviousShmemStartupHook=shmem_startup_hook;
26822684
shmem_startup_hook=MtmShmemStartup;
26832685

2686+
PreviousExecutorStartHook=ExecutorStart_hook;
2687+
ExecutorStart_hook=MtmExecutorStart;
2688+
26842689
PreviousExecutorFinishHook=ExecutorFinish_hook;
26852690
ExecutorFinish_hook=MtmExecutorFinish;
26862691

@@ -3978,12 +3983,34 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
39783983
MtmTx.snapshot=INVALID_CSN;
39793984
}
39803985

3981-
if (executed&& !skipCommand)
3986+
if (executed)
39823987
{
39833988
MtmFinishDDLCommand();
39843989
}
39853990
}
39863991

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

39884015
staticvoid
39894016
MtmExecutorFinish(QueryDesc*queryDesc)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp