diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-17 17:33:37 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-17 17:33:37 +0000 |
commit | 754da88e19e56a6aaba06a57f45fdf1b5ae792a3 (patch) | |
tree | 0dcbed1bb16054939b9f794a0637532e71f582c0 /src/pl/plperl/plperl.c | |
parent | 8372956243a477a67f1d01674c86f0285f05ccbb (diff) | |
download | postgresql-754da88e19e56a6aaba06a57f45fdf1b5ae792a3.tar.gz postgresql-754da88e19e56a6aaba06a57f45fdf1b5ae792a3.zip |
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.
Diffstat (limited to 'src/pl/plperl/plperl.c')
-rw-r--r-- | src/pl/plperl/plperl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index c14e6eb60f9..96c8705e225 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -33,7 +33,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.67.4.4 2006/01/08 15:51:18 adunstan Exp $ + * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.67.4.5 2006/01/17 17:33:35 tgl Exp $ * **********************************************************************/ @@ -705,12 +705,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 { @@ -1009,7 +1011,7 @@ plperl_func_handler(PG_FUNCTION_ARGS) */ td = get_function_tupdesc(prodesc->result_oid, (ReturnSetInfo *) fcinfo->resultinfo); - /* td = CreateTupleDescCopy(td); */ + td = CreateTupleDescCopy(td); attinmeta = TupleDescGetAttInMetadata(td); tup = plperl_build_tuple_result(perlhash, attinmeta); |