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) ?
Showing
Please register or sign in to comment