*/
if (scanstate->ss.ps.plan->qual)
{
- List *local_qual = NIL;
- List *foreign_qual = NIL;
List *foreign_expr = NIL;
ListCell *lc;
ExprState *state = lfirst(lc);
if (is_foreign_qual(state->expr))
- { foreign_qual = lappend(foreign_qual, state);
foreign_expr = lappend(foreign_expr, state->expr);
- }
- else
- local_qual = lappend(local_qual, state);
}
- /*
- * XXX: If the remote side is not reliable enough, we can keep the qual
- * in PlanState as is and evaluate them on local side too. If so, just
- * omit replacement below.
- */
- scanstate->ss.ps.qual = local_qual;
/*
* Deparse quals to be evaluated in the foreign server if any.
node = (Node *) make_ands_explicit(foreign_expr);
appendStringInfo(&sql, " WHERE %s",
deparse_expression(node, context, prefix, false));
+
/*
* The contents of the list MUST NOT be free-ed because they are
* referenced from Plan.qual list.