mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Fix problems with cached tuple descriptors disappearing while still in use
by creating a reference-count mechanism, similar to what we did a long time ago for catcache entries. The back branches have an ugly solution involving lots of extra copies, but this way is more efficient. Reference counting is only applied to tupdescs that are actually in caches --- there seems no need to use it for tupdescs that are generated in the executor, since they'll go away during plan shutdown by virtue of being in the per-query memory context. Neil Conway and Tom Lane
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execJunk.c,v 1.52 2006/03/05 15:58:25 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execJunk.c,v 1.53 2006/06/16 18:42:21 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -79,7 +79,7 @@ ExecInitJunkFilter(List *targetList, bool hasoid, TupleTableSlot *slot)
|
||||
* Use the given slot, or make a new slot if we weren't given one.
|
||||
*/
|
||||
if (slot)
|
||||
ExecSetSlotDescriptor(slot, cleanTupType, false);
|
||||
ExecSetSlotDescriptor(slot, cleanTupType);
|
||||
else
|
||||
slot = MakeSingleTupleTableSlot(cleanTupType);
|
||||
|
||||
@ -150,7 +150,7 @@ ExecInitJunkFilterConversion(List *targetList,
|
||||
* Use the given slot, or make a new slot if we weren't given one.
|
||||
*/
|
||||
if (slot)
|
||||
ExecSetSlotDescriptor(slot, cleanTupType, false);
|
||||
ExecSetSlotDescriptor(slot, cleanTupType);
|
||||
else
|
||||
slot = MakeSingleTupleTableSlot(cleanTupType);
|
||||
|
||||
|
Reference in New Issue
Block a user