Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea15e18

Browse files
committed
Remove obsoleted code relating to targetlist SRF evaluation.
Since69f4b9c plain expression evaluation (and thus normal projection)can't return sets of tuples anymore. Thus remove code dealing withthat possibility.This will require adjustments in external code usingExecEvalExpr()/ExecProject() - that should neither be hard nor verycommon.Author: Andres Freund and Tom LaneDiscussion:https://postgr.es/m/20160822214023.aaxz5l4igypowyri@alap3.anarazel.de
1 parent8eace46 commitea15e18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+352
-1208
lines changed

‎contrib/postgres_fdw/postgres_fdw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3444,7 +3444,7 @@ process_query_params(ExprContext *econtext,
34443444
boolisNull;
34453445

34463446
/* Evaluate the parameter expression */
3447-
expr_value=ExecEvalExpr(expr_state,econtext,&isNull,NULL);
3447+
expr_value=ExecEvalExpr(expr_state,econtext,&isNull);
34483448

34493449
/*
34503450
* Get string representation of each parameter value by invoking

‎src/backend/catalog/index.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,8 +1805,7 @@ FormIndexDatum(IndexInfo *indexInfo,
18051805
elog(ERROR,"wrong number of index expressions");
18061806
iDatum=ExecEvalExprSwitchContext((ExprState*)lfirst(indexpr_item),
18071807
GetPerTupleExprContext(estate),
1808-
&isNull,
1809-
NULL);
1808+
&isNull);
18101809
indexpr_item=lnext(indexpr_item);
18111810
}
18121811
values[i]=iDatum;

‎src/backend/catalog/partition.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
13581358
test_exprstate=ExecInitExpr(test_expr,NULL);
13591359
test_result=ExecEvalExprSwitchContext(test_exprstate,
13601360
GetPerTupleExprContext(estate),
1361-
&isNull,NULL);
1361+
&isNull);
13621362
MemoryContextSwitchTo(oldcxt);
13631363
FreeExecutorState(estate);
13641364

@@ -1630,8 +1630,7 @@ FormPartitionKeyDatum(PartitionDispatch pd,
16301630
elog(ERROR,"wrong number of partition key expressions");
16311631
datum=ExecEvalExprSwitchContext((ExprState*)lfirst(partexpr_item),
16321632
GetPerTupleExprContext(estate),
1633-
&isNull,
1634-
NULL);
1633+
&isNull);
16351634
partexpr_item=lnext(partexpr_item);
16361635
}
16371636
values[i]=datum;

‎src/backend/commands/copy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3394,7 +3394,7 @@ NextCopyFrom(CopyState cstate, ExprContext *econtext,
33943394
Assert(CurrentMemoryContext==econtext->ecxt_per_tuple_memory);
33953395

33963396
values[defmap[i]]=ExecEvalExpr(defexprs[i],econtext,
3397-
&nulls[defmap[i]],NULL);
3397+
&nulls[defmap[i]]);
33983398
}
33993399

34003400
return true;

‎src/backend/commands/prepare.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,7 @@ EvaluateParams(PreparedStatement *pstmt, List *params,
413413
prm->pflags=PARAM_FLAG_CONST;
414414
prm->value=ExecEvalExprSwitchContext(n,
415415
GetPerTupleExprContext(estate),
416-
&prm->isnull,
417-
NULL);
416+
&prm->isnull);
418417

419418
i++;
420419
}

‎src/backend/commands/tablecmds.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4460,8 +4460,7 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode)
44604460

44614461
values[ex->attnum-1]=ExecEvalExpr(ex->exprstate,
44624462
econtext,
4463-
&isnull[ex->attnum-1],
4464-
NULL);
4463+
&isnull[ex->attnum-1]);
44654464
}
44664465

44674466
/*

‎src/backend/commands/typecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2735,7 +2735,7 @@ validateDomainConstraint(Oid domainoid, char *ccbin)
27352735

27362736
conResult=ExecEvalExprSwitchContext(exprstate,
27372737
econtext,
2738-
&isNull,NULL);
2738+
&isNull);
27392739

27402740
if (!isNull&& !DatumGetBool(conResult))
27412741
{

‎src/backend/executor/execAmi.c

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
#include"utils/syscache.h"
6060

6161

62-
staticboolTargetListSupportsBackwardScan(List*targetlist);
6362
staticboolIndexSupportsBackwardScan(Oidindexid);
6463

6564

@@ -120,7 +119,7 @@ ExecReScan(PlanState *node)
120119
UpdateChangedParamSet(node->righttree,node->chgParam);
121120
}
122121

123-
/*Shut down any SRFs in the plan node's targetlist */
122+
/*Call expression callbacks */
124123
if (node->ps_ExprContext)
125124
ReScanExprContext(node->ps_ExprContext);
126125

@@ -460,8 +459,7 @@ ExecSupportsBackwardScan(Plan *node)
460459
{
461460
caseT_Result:
462461
if (outerPlan(node)!=NULL)
463-
returnExecSupportsBackwardScan(outerPlan(node))&&
464-
TargetListSupportsBackwardScan(node->targetlist);
462+
returnExecSupportsBackwardScan(outerPlan(node));
465463
else
466464
return false;
467465

@@ -478,13 +476,6 @@ ExecSupportsBackwardScan(Plan *node)
478476
return true;
479477
}
480478

481-
caseT_SeqScan:
482-
caseT_TidScan:
483-
caseT_FunctionScan:
484-
caseT_ValuesScan:
485-
caseT_CteScan:
486-
returnTargetListSupportsBackwardScan(node->targetlist);
487-
488479
caseT_SampleScan:
489480
/* Simplify life for tablesample methods by disallowing this */
490481
return false;
@@ -493,54 +484,41 @@ ExecSupportsBackwardScan(Plan *node)
493484
return false;
494485

495486
caseT_IndexScan:
496-
returnIndexSupportsBackwardScan(((IndexScan*)node)->indexid)&&
497-
TargetListSupportsBackwardScan(node->targetlist);
487+
returnIndexSupportsBackwardScan(((IndexScan*)node)->indexid);
498488

499489
caseT_IndexOnlyScan:
500-
returnIndexSupportsBackwardScan(((IndexOnlyScan*)node)->indexid)&&
501-
TargetListSupportsBackwardScan(node->targetlist);
490+
returnIndexSupportsBackwardScan(((IndexOnlyScan*)node)->indexid);
502491

503492
caseT_SubqueryScan:
504-
returnExecSupportsBackwardScan(((SubqueryScan*)node)->subplan)&&
505-
TargetListSupportsBackwardScan(node->targetlist);
493+
returnExecSupportsBackwardScan(((SubqueryScan*)node)->subplan);
506494

507495
caseT_CustomScan:
508496
{
509497
uint32flags= ((CustomScan*)node)->flags;
510498

511-
if ((flags&CUSTOMPATH_SUPPORT_BACKWARD_SCAN)&&
512-
TargetListSupportsBackwardScan(node->targetlist))
499+
if (flags&CUSTOMPATH_SUPPORT_BACKWARD_SCAN)
513500
return true;
514501
}
515502
return false;
516503

504+
caseT_SeqScan:
505+
caseT_TidScan:
506+
caseT_FunctionScan:
507+
caseT_ValuesScan:
508+
caseT_CteScan:
517509
caseT_Material:
518510
caseT_Sort:
519-
/* these don't evaluate tlist */
520511
return true;
521512

522513
caseT_LockRows:
523514
caseT_Limit:
524-
/* these don't evaluate tlist */
525515
returnExecSupportsBackwardScan(outerPlan(node));
526516

527517
default:
528518
return false;
529519
}
530520
}
531521

532-
/*
533-
* If the tlist contains set-returning functions, we can't support backward
534-
* scan, because the TupFromTlist code is direction-ignorant.
535-
*/
536-
staticbool
537-
TargetListSupportsBackwardScan(List*targetlist)
538-
{
539-
if (expression_returns_set((Node*)targetlist))
540-
return false;
541-
return true;
542-
}
543-
544522
/*
545523
* An IndexScan or IndexOnlyScan node supports backward scan only if the
546524
* index's AM does.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp