From 754da88e19e56a6aaba06a57f45fdf1b5ae792a3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 17 Jan 2006 17:33:37 +0000 Subject: 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. --- src/pl/plpython/plpython.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pl/plpython/plpython.c') diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index b93a94c8826..851a89ae2ab 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -29,7 +29,7 @@ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.58.4.4 2006/01/10 00:33:48 neilc Exp $ + * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.58.4.5 2006/01/17 17:33:37 tgl Exp $ * ********************************************************************* */ @@ -861,6 +861,7 @@ PLy_function_build_args(FunctionCallInfo fcinfo, PLyProcedure * proc) tupType = HeapTupleHeaderGetTypeId(td); tupTypmod = HeapTupleHeaderGetTypMod(td); tupdesc = lookup_rowtype_tupdesc(tupType, tupTypmod); + tupdesc = CreateTupleDescCopy(tupdesc); /* Set up I/O funcs if not done yet */ if (proc->args[i].is_rowtype != 1) @@ -871,6 +872,7 @@ PLy_function_build_args(FunctionCallInfo fcinfo, PLyProcedure * proc) tmptup.t_data = td; arg = PLyDict_FromTuple(&(proc->args[i]), &tmptup, tupdesc); + FreeTupleDesc(tupdesc); } } else -- cgit v1.2.3