Commit 13b6f724 authored by Bruce Momjian's avatar Bruce Momjian

Tatsuo Ishii fix for pg_user crash, with slight modification.

parent a752e322
...@@ -6,7 +6,7 @@ ...@@ -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, ...@@ -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, ...@@ -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;
} }
......
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