1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Repair problems with the result of lookup_rowtype_tupdesc() possibly being

discarded by cache flush while still in use.  This is a minimal patch that
just copies the tupdesc anywhere it could be needed across a flush.  Applied
to back branches only; Neil Conway is working on a better long-term solution
for HEAD.
This commit is contained in:
Tom Lane
2006-01-17 17:33:23 +00:00
parent afe91cae6c
commit 7b3d9367b4
11 changed files with 49 additions and 17 deletions

View File

@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.94.2.2 2006/01/08 15:50:00 adunstan Exp $
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.94.2.3 2006/01/17 17:33:22 tgl Exp $
*
**********************************************************************/
@ -796,12 +796,14 @@ plperl_call_perl_func(plperl_proc_desc *desc, FunctionCallInfo fcinfo)
tupType = HeapTupleHeaderGetTypeId(td);
tupTypmod = HeapTupleHeaderGetTypMod(td);
tupdesc = lookup_rowtype_tupdesc(tupType, tupTypmod);
tupdesc = CreateTupleDescCopy(tupdesc);
/* Build a temporary HeapTuple control structure */
tmptup.t_len = HeapTupleHeaderGetDatumLength(td);
tmptup.t_data = td;
hashref = plperl_hash_from_tuple(&tmptup, tupdesc);
XPUSHs(sv_2mortal(hashref));
FreeTupleDesc(tupdesc);
}
else
{