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/tcl/pltcl.c | |
parent | 8372956243a477a67f1d01674c86f0285f05ccbb (diff) |
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/tcl/pltcl.c')
-rw-r--r-- | src/pl/tcl/pltcl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c index a95344759a3..7928f3eb761 100644 --- a/src/pl/tcl/pltcl.c +++ b/src/pl/tcl/pltcl.c @@ -31,7 +31,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.94 2004/11/21 21:17:05 tgl Exp $ + * $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.94.4.1 2006/01/17 17:33:37 tgl Exp $ * **********************************************************************/ @@ -533,6 +533,7 @@ pltcl_func_handler(PG_FUNCTION_ARGS) 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; @@ -541,6 +542,7 @@ pltcl_func_handler(PG_FUNCTION_ARGS) pltcl_build_tuple_argument(&tmptup, tupdesc, &list_tmp); Tcl_DStringAppendElement(&tcl_cmd, Tcl_DStringValue(&list_tmp)); + FreeTupleDesc(tupdesc); } } else |