diff --git a/src/backend/distributed/commands/call.c b/src/backend/distributed/commands/call.c index 6d620301b..fa30093d5 100644 --- a/src/backend/distributed/commands/call.c +++ b/src/backend/distributed/commands/call.c @@ -167,7 +167,7 @@ CallFuncExprRemotely(CallStmt *callStmt, DistObjectCacheEntry *procedure, Task *task = CitusMakeNode(Task); task->jobId = INVALID_JOB_ID; - task->taskId = 0; + task->taskId = INVALID_TASK_ID; task->taskType = DDL_TASK; SetTaskQueryString(task, callCommand->data); task->replicationModel = REPLICATION_MODEL_INVALID; diff --git a/src/backend/distributed/commands/create_distributed_table.c b/src/backend/distributed/commands/create_distributed_table.c index 5bfbb73af..c42edb8f5 100644 --- a/src/backend/distributed/commands/create_distributed_table.c +++ b/src/backend/distributed/commands/create_distributed_table.c @@ -619,7 +619,7 @@ ColocationIdForNewTable(Oid relationId, Var *distributionColumn, * distributing table here. If there is an unsatisfied requirement, we error out * and do not distribute the table. * - * This function assumes, callers have already acquried necessary locks to ensure + * This function assumes, callers have already acquired necessary locks to ensure * there will not be any change in the given relation. */ static void diff --git a/src/backend/distributed/executor/adaptive_executor.c b/src/backend/distributed/executor/adaptive_executor.c index 503500560..54c3048f9 100644 --- a/src/backend/distributed/executor/adaptive_executor.c +++ b/src/backend/distributed/executor/adaptive_executor.c @@ -2015,7 +2015,7 @@ ShouldRunTasksSequentially(List *taskList) /* * SequentialRunDistributedExecution gets a distributed execution and - * executes each individual task in the exection sequentially, one + * executes each individual task in the execution sequentially, one * task at a time. See related function ShouldRunTasksSequentially() * for more detail on the definition of SequentialRun. */ diff --git a/src/backend/distributed/master/master_delete_protocol.c b/src/backend/distributed/master/master_delete_protocol.c index ad82e01e8..397e1459e 100644 --- a/src/backend/distributed/master/master_delete_protocol.c +++ b/src/backend/distributed/master/master_delete_protocol.c @@ -216,7 +216,6 @@ master_drop_all_shards(PG_FUNCTION_ARGS) text *schemaNameText = PG_GETARG_TEXT_P(1); text *relationNameText = PG_GETARG_TEXT_P(2); - char *schemaName = text_to_cstring(schemaNameText); char *relationName = text_to_cstring(relationNameText); @@ -237,7 +236,7 @@ master_drop_all_shards(PG_FUNCTION_ARGS) /* * master_drop_all_shards is typically called from the DROP TABLE trigger, * but could be called by a user directly. Make sure we have an - * AccessExlusiveLock to prevent any other commands from running on this table + * AccessExclusiveLock to prevent any other commands from running on this table * concurrently. */ LockRelationOid(relationId, AccessExclusiveLock); diff --git a/src/backend/distributed/utils/multi_partitioning_utils.c b/src/backend/distributed/utils/multi_partitioning_utils.c index f62c6bcfc..ec44423e1 100644 --- a/src/backend/distributed/utils/multi_partitioning_utils.c +++ b/src/backend/distributed/utils/multi_partitioning_utils.c @@ -31,11 +31,9 @@ #include "utils/rel.h" #include "utils/syscache.h" - static char * PartitionBound(Oid partitionId); static Relation try_relation_open_nolock(Oid relationId); - /* * Returns true if the given relation is a partitioned table. */ @@ -43,7 +41,6 @@ bool PartitionedTable(Oid relationId) { Relation rel = try_relation_open(relationId, AccessShareLock); - bool partitionedTable = false; /* don't error out for tables that are dropped */ if (rel == NULL) @@ -51,6 +48,8 @@ PartitionedTable(Oid relationId) return false; } + bool partitionedTable = false; + if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) { partitionedTable = true; diff --git a/src/backend/distributed/worker/worker_truncate_trigger_protocol.c b/src/backend/distributed/worker/worker_truncate_trigger_protocol.c index afb06a76b..ba44adfb1 100644 --- a/src/backend/distributed/worker/worker_truncate_trigger_protocol.c +++ b/src/backend/distributed/worker/worker_truncate_trigger_protocol.c @@ -28,7 +28,7 @@ PG_FUNCTION_INFO_V1(worker_create_truncate_trigger); /* * worker_create_truncate_trigger creates a truncate trigger for the given distributed - * table on current metadata worker. The function is intented to be called by the + * table on current metadata worker. The function is intended to be called by the * coordinator node during metadata propagation of mx tables or during the upgrades from * citus version <=5.2 to >=6.1. The function requires superuser permissions. */