@@ -3598,6 +3598,7 @@ typedef struct MtmGucHashEntry
35983598}MtmGucHashEntry ;
35993599
36003600static HTAB * MtmGucHash = NULL ;
3601+ static List * MtmGucList = NULL ;
36013602
36023603static void MtmGucHashInit (void )
36033604{
@@ -3618,7 +3619,6 @@ static void MtmGucSet(VariableSetStmt *stmt, const char *queryStr)
36183619MemoryContext oldcontext ;
36193620MtmGucHashEntry * hentry ;
36203621bool found ;
3621- char * key ;
36223622
36233623if (!MtmGucHash )
36243624MtmGucHashInit ();
@@ -3628,54 +3628,30 @@ static void MtmGucSet(VariableSetStmt *stmt, const char *queryStr)
36283628switch (stmt -> kind )
36293629{
36303630case VAR_SET_VALUE :
3631- case VAR_SET_DEFAULT :
3632- case VAR_SET_CURRENT :
3633- {
3634- char * value ;
3635-
3636- key = pstrdup (stmt -> name );
3637- hash_search (MtmGucHash ,key ,HASH_FIND ,& found );
3638- value = ExtractSetVariableArgs (stmt );
3639-
3640- fprintf (stderr ,":MtmGucSet: %s -> %s\n" ,key ,value );
3641-
3642- if (value )
3643- {
3644- hentry = (MtmGucHashEntry * )hash_search (MtmGucHash ,key ,
3645- HASH_ENTER ,& found );
3646-
3647- // if (found)
3648- // pfree(hentry->value);
3631+ hentry = (MtmGucHashEntry * )hash_search (MtmGucHash ,stmt -> name ,
3632+ HASH_ENTER ,& found );
3633+ if (found )
3634+ pfree (hentry -> value );
3635+ hentry -> value = ExtractSetVariableArgs (stmt );
3636+ break ;
36493637
3650- hentry -> value = palloc (strlen (value )+ 1 );
3651- strcpy (hentry -> value ,value );
3652- }
3653- else if (found )
3654- {
3655- /* That was SET TO DEFAULT and we already had some value */
3656- hash_search (MtmGucHash ,key ,HASH_REMOVE ,NULL );
3657- }
3658- }
3638+ case VAR_SET_DEFAULT :
3639+ hash_search (MtmGucHash ,stmt -> name ,HASH_REMOVE ,NULL );
36593640break ;
36603641
36613642case VAR_RESET :
3662- {
3663- if (strcmp (stmt -> name ,"session_authorization" )== 0 )
3664- {
3665- hash_search (MtmGucHash ,"role" ,HASH_REMOVE ,NULL );
3666- }
3667- key = pstrdup (stmt -> name );
3668- hash_search (MtmGucHash ,key ,HASH_REMOVE ,NULL );
3669- }
3643+ if (strcmp (stmt -> name ,"session_authorization" )== 0 )
3644+ hash_search (MtmGucHash ,"role" ,HASH_REMOVE ,NULL );
3645+ hash_search (MtmGucHash ,stmt -> name ,HASH_REMOVE ,NULL );
36703646break ;
36713647
36723648case VAR_RESET_ALL :
3673- {
3674- hash_destroy (MtmGucHash );
3675- MtmGucHashInit ();
3676- }
3649+ /* XXX: shouldn't we keep auth/role here? */
3650+ hash_destroy (MtmGucHash );
3651+ MtmGucHashInit ();
36773652break ;
36783653
3654+ case VAR_SET_CURRENT :
36793655case VAR_SET_MULTI :
36803656break ;
36813657}
@@ -4000,10 +3976,19 @@ MtmExecutorStart(QueryDesc *queryDesc, int eflags)
40003976TargetEntry * tle = (TargetEntry * )lfirst (tlist );
40013977
40023978if (tle -> resname && strcmp (tle -> resname ,"lo_create" )== 0 )
3979+ {
40033980ddl_generating_call = true;
3981+ break ;
3982+ }
3983+
3984+ if (tle -> resname && strcmp (tle -> resname ,"lo_unlink" )== 0 )
3985+ {
3986+ ddl_generating_call = true;
3987+ break ;
3988+ }
40043989}
40053990
4006- if (ddl_generating_call )
3991+ if (ddl_generating_call && ! MtmTx . isReplicated )
40073992MtmProcessDDLCommand (ActivePortal -> sourceText , true);
40083993
40093994if (PreviousExecutorStartHook != NULL )