aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/nodes')
-rw-r--r--src/backend/nodes/copyfuncs.c25
-rw-r--r--src/backend/nodes/equalfuncs.c18
2 files changed, 36 insertions, 7 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 6977a6081de..153d257d26c 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.160 2001/11/05 05:00:14 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.161 2002/02/18 23:11:14 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1893,9 +1893,9 @@ _copyGrantStmt(GrantStmt *from)
GrantStmt *newnode = makeNode(GrantStmt);
newnode->is_grant = from->is_grant;
- Node_Copy(from, newnode, relnames);
- if (from->privileges)
- newnode->privileges = pstrdup(from->privileges);
+ newnode->objtype = from->objtype;
+ Node_Copy(from, newnode, objects);
+ Node_Copy(from, newnode, privileges);
Node_Copy(from, newnode, grantees);
return newnode;
@@ -1914,6 +1914,20 @@ _copyPrivGrantee(PrivGrantee *from)
return newnode;
}
+static FuncWithArgs *
+_copyFuncWithArgs(FuncWithArgs *from)
+{
+ FuncWithArgs *newnode = makeNode(FuncWithArgs);
+
+ if (from->funcname)
+ newnode->funcname = pstrdup(from->funcname);
+ else
+ newnode->funcname = NULL;
+ Node_Copy(from, newnode, funcargs);
+
+ return newnode;
+}
+
static ClosePortalStmt *
_copyClosePortalStmt(ClosePortalStmt *from)
{
@@ -2971,6 +2985,9 @@ copyObject(void *from)
case T_PrivGrantee:
retval = _copyPrivGrantee(from);
break;
+ case T_FuncWithArgs:
+ retval = _copyFuncWithArgs(from);
+ break;
default:
elog(ERROR, "copyObject: don't know how to copy node type %d",
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 538a773e31b..886963f8808 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -20,7 +20,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.108 2001/11/05 05:00:14 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.109 2002/02/18 23:11:14 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -758,9 +758,11 @@ _equalGrantStmt(GrantStmt *a, GrantStmt *b)
{
if (a->is_grant != b->is_grant)
return false;
- if (!equal(a->relnames, b->relnames))
+ if (a->objtype != b->objtype)
+ return false;
+ if (!equal(a->objects, b->objects))
return false;
- if (!equalstr(a->privileges, b->privileges))
+ if (!equal(a->privileges, b->privileges))
return false;
if (!equal(a->grantees, b->grantees))
return false;
@@ -776,6 +778,13 @@ _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
}
static bool
+_equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
+{
+ return equalstr(a->funcname, b->funcname)
+ && equal(a->funcargs, b->funcargs);
+}
+
+static bool
_equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
{
if (!equalstr(a->portalname, b->portalname))
@@ -2122,6 +2131,9 @@ equal(void *a, void *b)
case T_PrivGrantee:
retval = _equalPrivGrantee(a, b);
break;
+ case T_FuncWithArgs:
+ retval = _equalFuncWithArgs(a, b);
+ break;
default:
elog(NOTICE, "equal: don't know whether nodes of type %d are equal",