Drop unreachable code from query_pushdown_planning.c (#6451)

Given that we cannot continue after a `RaiseDeferredErrorInternal(..,
ERROR)` call.
pull/6452/head^2
Onur Tirtir 2022-10-21 18:04:31 +03:00 committed by GitHub
parent 7f05ad033a
commit dbe2749bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 29 deletions

View File

@ -521,8 +521,6 @@ MultiNode *
SubqueryMultiNodeTree(Query *originalQuery, Query *queryTree,
PlannerRestrictionContext *plannerRestrictionContext)
{
MultiNode *multiQueryNode = NULL;
/*
* This is a generic error check that applies to both subquery pushdown
* and single table repartition subquery.
@ -534,39 +532,15 @@ SubqueryMultiNodeTree(Query *originalQuery, Query *queryTree,
RaiseDeferredError(unsupportedQueryError, ERROR);
}
/*
* In principle, we're first trying subquery pushdown planner. If it fails
* to create a logical plan, continue with trying the single table
* repartition subquery planning.
*/
DeferredErrorMessage *subqueryPushdownError = DeferErrorIfUnsupportedSubqueryPushdown(
originalQuery,
plannerRestrictionContext);
if (!subqueryPushdownError)
if (subqueryPushdownError != NULL)
{
multiQueryNode = SubqueryPushdownMultiNodeTree(originalQuery);
RaiseDeferredError(subqueryPushdownError, ERROR);
}
else if (subqueryPushdownError)
{
RaiseDeferredErrorInternal(subqueryPushdownError, ERROR);
List *subqueryEntryList = SubqueryEntryList(queryTree);
RangeTblEntry *subqueryRangeTableEntry = (RangeTblEntry *) linitial(
subqueryEntryList);
Assert(subqueryRangeTableEntry->rtekind == RTE_SUBQUERY);
Query *subqueryTree = subqueryRangeTableEntry->subquery;
DeferredErrorMessage *repartitionQueryError =
DeferErrorIfUnsupportedSubqueryRepartition(subqueryTree);
if (repartitionQueryError)
{
RaiseDeferredErrorInternal(repartitionQueryError, ERROR);
}
/* all checks have passed, safe to create the multi plan */
multiQueryNode = MultiNodeTree(queryTree);
}
MultiNode *multiQueryNode = SubqueryPushdownMultiNodeTree(originalQuery);
Assert(multiQueryNode != NULL);