Commit 7ab88a16 authored by Jan Wieck's avatar Jan Wieck

Fixed failed assertion happening in multiple action rules

when parsestate in makeRangeTable() already contains an
opened p_target_relation.

Jan
parent 4390b0bf
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.26 1998/09/25 13:36:03 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.27 1999/02/02 12:57:51 wieck Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -62,8 +62,13 @@ makeRangeTable(ParseState *pstate, char *relname, List *frmList) ...@@ -62,8 +62,13 @@ makeRangeTable(ParseState *pstate, char *relname, List *frmList)
else else
rte = refnameRangeTableEntry(pstate, relname); rte = refnameRangeTableEntry(pstate, relname);
/* This could only happen for multi-action rules */
if (pstate->p_target_relation != NULL)
{
heap_close(pstate->p_target_relation);
}
pstate->p_target_rangetblentry = rte; pstate->p_target_rangetblentry = rte;
Assert(pstate->p_target_relation == NULL);
pstate->p_target_relation = heap_open(rte->relid); pstate->p_target_relation = heap_open(rte->relid);
/* will close relation later */ /* will close relation later */
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment