mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Remove obsoleted code relating to targetlist SRF evaluation.
Since 69f4b9c
plain expression evaluation (and thus normal projection)
can't return sets of tuples anymore. Thus remove code dealing with
that possibility.
This will require adjustments in external code using
ExecEvalExpr()/ExecProject() - that should neither be hard nor very
common.
Author: Andres Freund and Tom Lane
Discussion: https://postgr.es/m/20160822214023.aaxz5l4igypowyri@alap3.anarazel.de
This commit is contained in:
@ -239,8 +239,7 @@ recompute_limits(LimitState *node)
|
||||
{
|
||||
val = ExecEvalExprSwitchContext(node->limitOffset,
|
||||
econtext,
|
||||
&isNull,
|
||||
NULL);
|
||||
&isNull);
|
||||
/* Interpret NULL offset as no offset */
|
||||
if (isNull)
|
||||
node->offset = 0;
|
||||
@ -263,8 +262,7 @@ recompute_limits(LimitState *node)
|
||||
{
|
||||
val = ExecEvalExprSwitchContext(node->limitCount,
|
||||
econtext,
|
||||
&isNull,
|
||||
NULL);
|
||||
&isNull);
|
||||
/* Interpret NULL count as no count (LIMIT ALL) */
|
||||
if (isNull)
|
||||
{
|
||||
@ -346,18 +344,11 @@ pass_down_bound(LimitState *node, PlanState *child_node)
|
||||
else if (IsA(child_node, ResultState))
|
||||
{
|
||||
/*
|
||||
* An extra consideration here is that if the Result is projecting a
|
||||
* targetlist that contains any SRFs, we can't assume that every input
|
||||
* tuple generates an output tuple, so a Sort underneath might need to
|
||||
* return more than N tuples to satisfy LIMIT N. So we cannot use
|
||||
* bounded sort.
|
||||
*
|
||||
* If Result supported qual checking, we'd have to punt on seeing a
|
||||
* qual, too. Note that having a resconstantqual is not a
|
||||
* showstopper: if that fails we're not getting any rows at all.
|
||||
* qual. Note that having a resconstantqual is not a showstopper: if
|
||||
* that fails we're not getting any rows at all.
|
||||
*/
|
||||
if (outerPlanState(child_node) &&
|
||||
!expression_returns_set((Node *) child_node->plan->targetlist))
|
||||
if (outerPlanState(child_node))
|
||||
pass_down_bound(node, outerPlanState(child_node));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user