1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Tatsuo Ishii fix for pg_user crash, with slight modification.

This commit is contained in:
Bruce Momjian
1998-09-11 16:39:59 +00:00
parent a752e322a3
commit 13b6f724c1

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.17 1998/09/01 04:31:35 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.18 1998/09/11 16:39:59 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -614,9 +614,8 @@ nodeHandleViewRule(Node **nodePtr,
var->varattno)); var->varattno));
if (n == NULL) if (n == NULL)
*nodePtr = make_null(((Var *) node)->vartype); *nodePtr = make_null(((Var *) node)->vartype);
else else
{
/* /*
* This is a hack: The varlevelsup of the orignal * This is a hack: The varlevelsup of the orignal
* variable and the new one should be the same. * variable and the new one should be the same.
@ -628,12 +627,16 @@ nodeHandleViewRule(Node **nodePtr,
* before! (Maybe this will cause troubles with * before! (Maybe this will cause troubles with
* some sophisticated queries on views?) * some sophisticated queries on views?)
*/ */
{
if (this_varlevelsup > 0) if (this_varlevelsup > 0)
*nodePtr = copyObject(n); *nodePtr = copyObject(n);
else else
*nodePtr = n; *nodePtr = n;
((Var *) *nodePtr)->varlevelsup = this_varlevelsup;
if (nodeTag(nodePtr) == T_Var)
((Var *) *nodePtr)->varlevelsup = this_varlevelsup;
else
nodeHandleViewRule(&n, rtable, targetlist,
rt_index, modified, sublevels_up);
} }
*modified = TRUE; *modified = TRUE;
} }