Fix for rules system from Jan.

This commit is contained in:
Bruce Momjian 1998-10-20 17:21:44 +00:00
parent 6d98d3737a
commit d7fc00c20d
2 changed files with 8 additions and 7 deletions

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.23 1998/10/02 21:53:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.24 1998/10/20 17:21:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1789,11 +1789,11 @@ apply_RIR_view(Node **nodePtr, int rt_index, RangeTblEntry *rte, List *tlist, in
return; return;
} }
exp = copyObject(exp);
if (var->varlevelsup > 0 && if (var->varlevelsup > 0 &&
nodeTag(exp) == T_Var) { nodeTag(exp) == T_Var) {
exp = copyObject(exp);
((Var *)exp)->varlevelsup = var->varlevelsup; ((Var *)exp)->varlevelsup = var->varlevelsup;
} }
*nodePtr = exp; *nodePtr = exp;
*modified = TRUE; *modified = TRUE;
} }

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.20 1998/10/08 18:29:52 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.21 1998/10/20 17:21:44 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -418,14 +418,15 @@ ResolveNew(RewriteInfo *info, List *targetlist, Node **nodePtr,
{ {
if (info->event == CMD_UPDATE) if (info->event == CMD_UPDATE)
{ {
((Var *) node)->varno = info->current_varno; *nodePtr = n = copyObject(node);
((Var *) node)->varnoold = info->current_varno; ((Var *) n)->varno = info->current_varno;
((Var *) n)->varnoold = info->current_varno;
} }
else else
*nodePtr = make_null(((Var *) node)->vartype); *nodePtr = make_null(((Var *) node)->vartype);
} }
else else
*nodePtr = n; *nodePtr = copyObject(n);
} }
break; break;
} }