@@ -229,12 +229,14 @@ static int MtmGcPeriod;
229
229
static bool MtmIgnoreTablesWithoutPk ;
230
230
static int MtmLockCount ;
231
231
232
+ static ExecutorStart_hook_type PreviousExecutorStartHook ;
232
233
static ExecutorFinish_hook_type PreviousExecutorFinishHook ;
233
234
static ProcessUtility_hook_type PreviousProcessUtilityHook ;
234
235
static shmem_startup_hook_type PreviousShmemStartupHook ;
235
236
236
237
static nodemask_t lastKnownMatrix [MAX_NODES ];
237
238
239
+ static void MtmExecutorStart (QueryDesc * queryDesc , int eflags );
238
240
static void MtmExecutorFinish (QueryDesc * queryDesc );
239
241
static void MtmProcessUtility (Node * parsetree , const char * queryString ,
240
242
ProcessUtilityContext context , ParamListInfo params ,
@@ -2675,6 +2677,9 @@ _PG_init(void)
2675
2677
PreviousShmemStartupHook = shmem_startup_hook ;
2676
2678
shmem_startup_hook = MtmShmemStartup ;
2677
2679
2680
+ PreviousExecutorStartHook = ExecutorStart_hook ;
2681
+ ExecutorStart_hook = MtmExecutorStart ;
2682
+
2678
2683
PreviousExecutorFinishHook = ExecutorFinish_hook ;
2679
2684
ExecutorFinish_hook = MtmExecutorFinish ;
2680
2685
@@ -3973,12 +3978,34 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
3973
3978
MtmTx .snapshot = INVALID_CSN ;
3974
3979
}
3975
3980
3976
- if (executed && ! skipCommand )
3981
+ if (executed )
3977
3982
{
3978
3983
MtmFinishDDLCommand ();
3979
3984
}
3980
3985
}
3981
3986
3987
+ static void
3988
+ MtmExecutorStart (QueryDesc * queryDesc , int eflags )
3989
+ {
3990
+ bool ddl_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
+ }
3982
4009
3983
4010
static void
3984
4011
MtmExecutorFinish (QueryDesc * queryDesc )
0 commit comments