mirror of https://github.com/citusdata/citus.git
Drop unreachable code from query_pushdown_planning.c (#6451)
Given that we cannot continue after a `RaiseDeferredErrorInternal(.., ERROR)` call.pull/6452/head^2
parent
7f05ad033a
commit
dbe2749bbf
|
@ -521,8 +521,6 @@ MultiNode *
|
||||||
SubqueryMultiNodeTree(Query *originalQuery, Query *queryTree,
|
SubqueryMultiNodeTree(Query *originalQuery, Query *queryTree,
|
||||||
PlannerRestrictionContext *plannerRestrictionContext)
|
PlannerRestrictionContext *plannerRestrictionContext)
|
||||||
{
|
{
|
||||||
MultiNode *multiQueryNode = NULL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a generic error check that applies to both subquery pushdown
|
* This is a generic error check that applies to both subquery pushdown
|
||||||
* and single table repartition subquery.
|
* and single table repartition subquery.
|
||||||
|
@ -534,39 +532,15 @@ SubqueryMultiNodeTree(Query *originalQuery, Query *queryTree,
|
||||||
RaiseDeferredError(unsupportedQueryError, ERROR);
|
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(
|
DeferredErrorMessage *subqueryPushdownError = DeferErrorIfUnsupportedSubqueryPushdown(
|
||||||
originalQuery,
|
originalQuery,
|
||||||
plannerRestrictionContext);
|
plannerRestrictionContext);
|
||||||
if (!subqueryPushdownError)
|
if (subqueryPushdownError != NULL)
|
||||||
{
|
{
|
||||||
multiQueryNode = SubqueryPushdownMultiNodeTree(originalQuery);
|
RaiseDeferredError(subqueryPushdownError, ERROR);
|
||||||
}
|
}
|
||||||
else if (subqueryPushdownError)
|
|
||||||
{
|
|
||||||
RaiseDeferredErrorInternal(subqueryPushdownError, ERROR);
|
|
||||||
|
|
||||||
List *subqueryEntryList = SubqueryEntryList(queryTree);
|
MultiNode *multiQueryNode = SubqueryPushdownMultiNodeTree(originalQuery);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
Assert(multiQueryNode != NULL);
|
Assert(multiQueryNode != NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue