1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-09 13:09:39 +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:
Tom Lane
2006-01-17 17:33:23 +00:00
parent afe91cae6c
commit 7b3d9367b4
11 changed files with 49 additions and 17 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.138.2.1 2005/11/22 18:23:14 momjian Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.138.2.2 2006/01/17 17:33:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -816,7 +816,8 @@ ExpandIndirectionStar(ParseState *pstate, A_Indirection *ind)
((Var *) expr)->vartype == RECORDOID)
tupleDesc = expandRecordVariable(pstate, (Var *) expr, 0);
else if (get_expr_result_type(expr, NULL, &tupleDesc) != TYPEFUNC_COMPOSITE)
tupleDesc = lookup_rowtype_tupdesc(exprType(expr), exprTypmod(expr));
tupleDesc = CreateTupleDescCopy(lookup_rowtype_tupdesc(exprType(expr),
exprTypmod(expr)));
Assert(tupleDesc);
/* Generate a list of references to the individual fields */
@@ -993,7 +994,8 @@ expandRecordVariable(ParseState *pstate, Var *var, int levelsup)
* appropriate error message while failing.
*/
if (get_expr_result_type(expr, NULL, &tupleDesc) != TYPEFUNC_COMPOSITE)
tupleDesc = lookup_rowtype_tupdesc(exprType(expr), exprTypmod(expr));
tupleDesc = CreateTupleDescCopy(lookup_rowtype_tupdesc(exprType(expr),
exprTypmod(expr)));
return tupleDesc;
}