mirror of https://github.com/citusdata/citus.git
wip
parent
5869859467
commit
f4f979bcc3
|
@ -934,7 +934,8 @@ DeferErrorIfCannotPushdownSubquery(Query *subqueryTree, bool outerMostQueryHasLi
|
|||
* push down SQL features within such a function, as long as co-located join
|
||||
* checks are applied.
|
||||
*/
|
||||
if (!contain_vars_of_level((Node *) subqueryTree, 1))
|
||||
#include "distributed/recursive_planning.h"
|
||||
if (!ContainsReferencesToOuterQuery(subqueryTree))
|
||||
{
|
||||
if (subqueryTree->limitOffset)
|
||||
{
|
||||
|
|
|
@ -171,7 +171,6 @@ static void RecursivelyPlanSubquery(Query *subquery,
|
|||
static DistributedSubPlan * CreateDistributedSubPlan(uint32 subPlanId,
|
||||
Query *subPlanQuery);
|
||||
static bool CteReferenceListWalker(Node *node, CteReferenceWalkerContext *context);
|
||||
static bool ContainsReferencesToOuterQuery(Query *query);
|
||||
static bool ContainsReferencesToOuterQueryWalker(Node *node,
|
||||
VarLevelsUpWalkerContext *context);
|
||||
static bool NodeContainsSubqueryReferencingOuterQuery(Node *node);
|
||||
|
@ -1238,7 +1237,7 @@ CteReferenceListWalker(Node *node, CteReferenceWalkerContext *context)
|
|||
* anything that points outside of the query itself. Such queries cannot be
|
||||
* planned recursively.
|
||||
*/
|
||||
static bool
|
||||
bool
|
||||
ContainsReferencesToOuterQuery(Query *query)
|
||||
{
|
||||
VarLevelsUpWalkerContext context = { 0 };
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include "nodes/relation.h"
|
||||
#endif
|
||||
|
||||
extern bool ContainsReferencesToOuterQuery(Query *query);
|
||||
|
||||
extern List * GenerateSubplansForSubqueriesAndCTEs(uint64 planId, Query *originalQuery,
|
||||
PlannerRestrictionContext *
|
||||
plannerRestrictionContext);
|
||||
|
|
Loading…
Reference in New Issue