Fixes review comments

pull/7563/head
gurkanindibay 2024-03-28 13:12:04 +03:00
parent 18e3924530
commit 98111eed96
2 changed files with 6 additions and 11 deletions

View File

@ -28,6 +28,7 @@
#include "utils/builtins.h"
#include "distributed/commands.h"
#include "distributed/commands/utility_hook.h"
#include "distributed/deparser.h"
#include "distributed/listutils.h"
#include "distributed/metadata_cache.h"
@ -159,7 +160,7 @@ static void UnmarkObjectDistributedOnLocalMainDb(uint16 catalogRelId, Oid object
bool
RunPreprocessNonMainDBCommand(Node *parsetree)
{
if (IsMainDB)
if (IsMainDB || !EnableDDLPropagation)
{
return false;
}
@ -215,7 +216,7 @@ RunPreprocessNonMainDBCommand(Node *parsetree)
void
RunPostprocessNonMainDBCommand(Node *parsetree)
{
if (IsMainDB || !GetNonMainDbDistributeObjectOps(parsetree))
if (IsMainDB || !EnableDDLPropagation || !GetNonMainDbDistributeObjectOps(parsetree))
{
return;
}

View File

@ -252,12 +252,8 @@ citus_ProcessUtility(PlannedStmt *pstmt,
* and if the command is a node-wide object management command that we
* support from non-main databases.
*/
bool shouldSkipPrevUtilityHook = false;
if (EnableDDLPropagation)
{
shouldSkipPrevUtilityHook = RunPreprocessNonMainDBCommand(parsetree);
}
bool shouldSkipPrevUtilityHook = RunPreprocessNonMainDBCommand(parsetree);
if (!shouldSkipPrevUtilityHook)
{
@ -268,10 +264,8 @@ citus_ProcessUtility(PlannedStmt *pstmt,
PrevProcessUtility(pstmt, queryString, false, context,
params, queryEnv, dest, completionTag);
}
if (EnableDDLPropagation)
{
RunPostprocessNonMainDBCommand(parsetree);
}
RunPostprocessNonMainDBCommand(parsetree);
return;
}