Miscellaneous cleanup

pull/6708/head^2
Teja Mupparti 2023-02-07 10:41:23 -08:00 committed by Teja Mupparti
parent b58de7f52c
commit 0824d9c1fb
3 changed files with 6 additions and 9 deletions

View File

@ -137,7 +137,7 @@ GeneratePlaceHolderPlannedStmt(Query *parse)
/* /*
* FastPathRouterQuery gets a query and returns true if the query is eligable for * FastPathRouterQuery gets a query and returns true if the query is eligible for
* being a fast path router query. * being a fast path router query.
* The requirements for the fast path query can be listed below: * The requirements for the fast path query can be listed below:
* *
@ -240,7 +240,7 @@ FastPathRouterQuery(Query *query, Node **distributionKeyValue)
* *
* We're also not allowing any other appearances of the distribution key in the quals. * We're also not allowing any other appearances of the distribution key in the quals.
* *
* Overall the logic is might sound fuzzy since it involves two individual checks: * Overall the logic might sound fuzzy since it involves two individual checks:
* (a) Check for top level AND operator with one side being "dist_key = const" * (a) Check for top level AND operator with one side being "dist_key = const"
* (b) Only allow single appearance of "dist_key" in the quals * (b) Only allow single appearance of "dist_key" in the quals
* *

View File

@ -3207,7 +3207,7 @@ BinaryOpExpression(Expr *clause, Node **leftOperand, Node **rightOperand)
} }
if (rightOperand != NULL) if (rightOperand != NULL)
{ {
*leftOperand = NULL; *rightOperand = NULL;
} }
return false; return false;
} }

View File

@ -896,7 +896,6 @@ ModifyQuerySupported(Query *queryTree, Query *originalQuery, bool multiShardQuer
} }
List *rangeTableList = NIL; List *rangeTableList = NIL;
uint32 queryTableCount = 0;
CmdType commandType = queryTree->commandType; CmdType commandType = queryTree->commandType;
bool fastPathRouterQuery = bool fastPathRouterQuery =
plannerRestrictionContext->fastPathRestrictionContext->fastPathRouterQuery; plannerRestrictionContext->fastPathRestrictionContext->fastPathRouterQuery;
@ -967,7 +966,7 @@ ModifyQuerySupported(Query *queryTree, Query *originalQuery, bool multiShardQuer
NULL, NULL); NULL, NULL);
} }
} }
/* for other kinds of relations, check if its distributed */ /* for other kinds of relations, check if it's distributed */
else else
{ {
if (IsRelationLocalTableOrMatView(rangeTableEntry->relid) && if (IsRelationLocalTableOrMatView(rangeTableEntry->relid) &&
@ -990,8 +989,6 @@ ModifyQuerySupported(Query *queryTree, Query *originalQuery, bool multiShardQuer
errorMessage->data, NULL, NULL); errorMessage->data, NULL, NULL);
} }
} }
queryTableCount++;
} }
else if (rangeTableEntry->rtekind == RTE_VALUES || else if (rangeTableEntry->rtekind == RTE_VALUES ||
rangeTableEntry->rtekind == RTE_RESULT rangeTableEntry->rtekind == RTE_RESULT
@ -2633,7 +2630,7 @@ GetAnchorShardId(List *prunedShardIntervalListList)
/* /*
* TargetShardIntervalForFastPathQuery gets a query which is in * TargetShardIntervalForFastPathQuery gets a query which is in
* the form defined by FastPathRouterQuery() and returns exactly * the form defined by FastPathRouterQuery() and returns exactly
* one list of a a one shard interval (see FastPathRouterQuery() * one list of one shard interval (see FastPathRouterQuery()
* for the detail). * for the detail).
* *
* If the caller requested the distributionKey value that this function * If the caller requested the distributionKey value that this function
@ -2659,7 +2656,7 @@ TargetShardIntervalForFastPathQuery(Query *query, bool *isMultiShardQuery,
/* /*
* We currently don't allow implicitly coerced values to be handled by fast- * We currently don't allow implicitly coerced values to be handled by fast-
* path planner. Still, let's be defensive for any future changes.. * path planner. Still, let's be defensive for any future changes.
*/ */
if (inputDistributionKeyValue->consttype != distributionKey->vartype) if (inputDistributionKeyValue->consttype != distributionKey->vartype)
{ {