]> granicus.if.org Git - postgresql/commit
Reset evaluation plan tuple table next free slot counter to 0
authorVadim B. Mikheev <vadim4o@yahoo.com>
Wed, 9 Jun 1999 12:23:42 +0000 (12:23 +0000)
committerVadim B. Mikheev <vadim4o@yahoo.com>
Wed, 9 Jun 1999 12:23:42 +0000 (12:23 +0000)
commit51298bcfdafd1cc60160485e5f7e6c872a09f29c
treebc77644fb1ed82f0ee7343bb103679caca6814f0
parent0e41fd57df6760f8978045cd27fd8de94e085964
Reset evaluation plan tuple table next free slot counter to 0
after ExecEndNode. It must be done! Or we'll be out of free
tuple slots very soon, though slots are freed by ExecEndNode
and ready for reusing.

We didn't see this problem before because of

int         nSlots = ExecCountSlotsNode(plan);
TupleTable  tupleTable = ExecCreateTupleTable(nSlots + 10);
    /* why add ten? - jolly */

code in InitPlan - i.e. extra 10 slots. Simple select uses
3 slots and so it was possible to re-use evaluation plan
3 additional times and didn't get

elog(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 if
something is still wrong. Is it better to change Assert
to elog(ERROR) ?
src/backend/executor/execMain.c