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

Commit51298bc

Browse files
committed
Reset evaluation plan tuple table next free slot counter to 0
after ExecEndNode. It must be done! Or we'll be out of freetuple slots very soon, though slots are freed by ExecEndNodeand ready for reusing.We didn't see this problem before because ofint nSlots = ExecCountSlotsNode(plan);TupleTable tupleTable = ExecCreateTupleTable(nSlots + 10); /* why add ten? - jolly */code in InitPlan - i.e. extra 10 slots. Simple select uses3 slots and so it was possible to re-use evaluation plan3 additional times and didn't getelog(NOTICE, "Plan requires more slots than are available");elog(ERROR, "send mail to your local executor guru to fix this");Changes are obvious and shouldn't be problems with them.Though, I added Assert(epqstate->es_tupleTable->next == 0)before EvalPlanQual():ExecInitNode and we'll notice ifsomething is still wrong. Is it better to change Assertto elog(ERROR) ?
1 parent0e41fd5 commit51298bc

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎src/backend/executor/execMain.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.86 1999/06/06 15:14:40 vadim Exp $
29+
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.87 1999/06/09 12:23:42 vadim Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -1673,6 +1673,7 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
16731673
Assert(oldepq->rti!=0);
16741674
/* stop execution */
16751675
ExecEndNode(epq->plan,epq->plan);
1676+
epqstate->es_tupleTable->next=0;
16761677
pfree(epqstate->es_evTuple[epq->rti-1]);
16771678
epqstate->es_evTuple[epq->rti-1]=NULL;
16781679
/* push current PQ to freePQ stack */
@@ -1741,7 +1742,10 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
17411742
* ability to use ExecReScan instead of ExecInitNode, so...
17421743
*/
17431744
if (endNode)
1745+
{
17441746
ExecEndNode(epq->plan,epq->plan);
1747+
epqstate->es_tupleTable->next=0;
1748+
}
17451749

17461750
/* free old RTE' tuple */
17471751
if (epqstate->es_evTuple[epq->rti-1]!=NULL)
@@ -1774,7 +1778,11 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
17741778
TransactionIdxwait=SnapshotDirty->xmax;
17751779

17761780
if (TransactionIdIsValid(SnapshotDirty->xmin))
1777-
elog(ERROR,"EvalPlanQual: t_xmin is uncommitted ?!");
1781+
{
1782+
elog(NOTICE,"EvalPlanQual: t_xmin is uncommitted ?!");
1783+
Assert(!TransactionIdIsValid(SnapshotDirty->xmin));
1784+
elog(ERROR,"Aborting this transaction");
1785+
}
17781786

17791787
/*
17801788
* If tuple is being updated by other transaction then we have
@@ -1836,6 +1844,7 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
18361844
estate->es_origPlan->nParamExec*sizeof(ParamExecData));
18371845
memset(epqstate->es_evTupleNull, false,
18381846
length(estate->es_range_table)*sizeof(bool));
1847+
Assert(epqstate->es_tupleTable->next==0);
18391848
ExecInitNode(epq->plan,epqstate,NULL);
18401849

18411850
/*
@@ -1866,6 +1875,7 @@ lpqnext:;
18661875
if (TupIsNull(slot))
18671876
{
18681877
ExecEndNode(epq->plan,epq->plan);
1878+
epqstate->es_tupleTable->next=0;
18691879
pfree(epqstate->es_evTuple[epq->rti-1]);
18701880
epqstate->es_evTuple[epq->rti-1]=NULL;
18711881
/* pop old PQ from the stack */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp