diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-17 17:33:23 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-17 17:33:23 +0000 |
commit | 7b3d9367b449f160fd4597094b0e18054d555b09 (patch) | |
tree | f109232720b413474b59d94070d1f8c860be39df /src/pl/plpython/plpython.c | |
parent | afe91cae6c45f5f06881651e6cea35972a0d4586 (diff) | |
download | postgresql-7b3d9367b449f160fd4597094b0e18054d555b09.tar.gz postgresql-7b3d9367b449f160fd4597094b0e18054d555b09.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/plpython/plpython.c')
-rw-r--r-- | src/pl/plpython/plpython.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 329387b428b..e9b9c5958d7 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.66.2.2 2006/01/10 00:33:30 neilc Exp $ + * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.66.2.3 2006/01/17 17:33:23 tgl Exp $ * ********************************************************************* */ @@ -862,6 +862,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) @@ -872,6 +873,7 @@ PLy_function_build_args(FunctionCallInfo fcinfo, PLyProcedure * proc) tmptup.t_data = td; arg = PLyDict_FromTuple(&(proc->args[i]), &tmptup, tupdesc); + FreeTupleDesc(tupdesc); } } else |