From 7e19ebe67999dff67949687165632d15e258cfc6 Mon Sep 17 00:00:00 2001 From: eren Date: Thu, 28 Apr 2016 15:58:44 +0300 Subject: [PATCH] FIX "mixed declarations and code" Warning in multi_physical_planner.c Fixes #477 This change fixes the compile time warning message in BuildMapMergeJob in multi_physical_planner.c about mixed declarations and code. Basically, the problematic declaration is moved up so that no expression is before it. --- src/backend/distributed/planner/multi_physical_planner.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/distributed/planner/multi_physical_planner.c b/src/backend/distributed/planner/multi_physical_planner.c index 7943968bd..45f364c3d 100644 --- a/src/backend/distributed/planner/multi_physical_planner.c +++ b/src/backend/distributed/planner/multi_physical_planner.c @@ -1729,6 +1729,7 @@ BuildMapMergeJob(Query *jobQuery, List *dependedJobList, Var *partitionKey, bool hasUninitializedShardInterval = false; uint32 shardCount = cache->shardIntervalArrayLength; ShardInterval **sortedShardIntervalArray = cache->sortedShardIntervalArray; + char basePartitionMethod PG_USED_FOR_ASSERTS_ONLY = 0; hasUninitializedShardInterval = cache->hasUninitializedShardInterval; if (hasUninitializedShardInterval) @@ -1737,9 +1738,9 @@ BuildMapMergeJob(Query *jobQuery, List *dependedJobList, Var *partitionKey, "missing min/max values"))); } + basePartitionMethod = PartitionMethod(baseRelationId); + /* this join-type currently doesn't work for hash partitioned tables */ - char basePartitionMethod PG_USED_FOR_ASSERTS_ONLY = - PartitionMethod(baseRelationId); Assert(basePartitionMethod != DISTRIBUTE_BY_HASH); mapMergeJob->partitionType = RANGE_PARTITION_TYPE;