Skip to content

Commit 92c6b5d

Browse files
Jan WieckJan Wieck
authored andcommitted
Fixed failed assertion happening in multiple action rules
when parsestate in makeRangeTable() already contains an opened p_target_relation. Jan
1 parent 575c0ed commit 92c6b5d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/backend/parser/parse_clause.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.26 1998/09/25 13:36:03 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.26.2.1 1999/02/02 12:56:55 wieck Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -62,8 +62,13 @@ makeRangeTable(ParseState *pstate, char *relname, List *frmList)
6262
else
6363
rte = refnameRangeTableEntry(pstate, relname);
6464

65+
/* This could only happen for multi-action rules */
66+
if (pstate->p_target_relation != NULL)
67+
{
68+
heap_close(pstate->p_target_relation);
69+
}
70+
6571
pstate->p_target_rangetblentry = rte;
66-
Assert(pstate->p_target_relation == NULL);
6772
pstate->p_target_relation = heap_open(rte->relid);
6873
/* will close relation later */
6974
}

0 commit comments

Comments
 (0)