mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +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:
@ -31,7 +31,7 @@
|
||||
* ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.98.2.1 2005/11/22 18:23:31 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.98.2.2 2006/01/17 17:33:23 tgl Exp $
|
||||
*
|
||||
**********************************************************************/
|
||||
|
||||
@ -531,6 +531,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;
|
||||
@ -539,6 +540,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
|
||||
|
Reference in New Issue
Block a user