1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Add missing copyfuncs/equalfuncs entries, including T_Null which has

been missing forever; surprising it wasn't noticed before.  The other
additions are, um, sloppiness in certain recent feature additions.
This commit is contained in:
Tom Lane
2002-08-19 00:11:53 +00:00
parent 6fb05e06a3
commit 5f6a27f8f9
2 changed files with 137 additions and 3 deletions

View File

@@ -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.150 2002/08/15 16:36:03 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.151 2002/08/19 00:11:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1459,6 +1459,51 @@ _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
return true;
}
static bool
_equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
{
if (!equal(a->conversion_name, b->conversion_name))
return false;
if (!equalstr(a->for_encoding_name, b->for_encoding_name))
return false;
if (!equalstr(a->to_encoding_name, b->to_encoding_name))
return false;
if (!equal(a->func_name, b->func_name))
return false;
if (a->def != b->def)
return false;
return true;
}
static bool
_equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
{
if (!equal(a->sourcetype, b->sourcetype))
return false;
if (!equal(a->targettype, b->targettype))
return false;
if (!equal(a->func, b->func))
return false;
if (a->implicit != b->implicit)
return false;
return true;
}
static bool
_equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
{
if (!equal(a->sourcetype, b->sourcetype))
return false;
if (!equal(a->targettype, b->targettype))
return false;
if (a->behavior != b->behavior)
return false;
return true;
}
static bool
_equalAExpr(A_Expr *a, A_Expr *b)
{
@@ -1881,7 +1926,11 @@ _equalValue(Value *a, Value *b)
case T_String:
case T_BitString:
return strcmp(a->val.str, b->val.str) == 0;
case T_Null:
/* nothing to do */
break;
default:
elog(ERROR, "_equalValue: unknown node type %d", a->type);
break;
}
@@ -2028,10 +2077,12 @@ equal(void *a, void *b)
retval = true;
}
break;
case T_Integer:
case T_Float:
case T_String:
case T_BitString:
case T_Null:
retval = _equalValue(a, b);
break;
@@ -2215,6 +2266,15 @@ equal(void *a, void *b)
case T_CreateSchemaStmt:
retval = _equalCreateSchemaStmt(a, b);
break;
case T_CreateConversionStmt:
retval = _equalCreateConversionStmt(a, b);
break;
case T_CreateCastStmt:
retval = _equalCreateCastStmt(a, b);
break;
case T_DropCastStmt:
retval = _equalDropCastStmt(a, b);
break;
case T_A_Expr:
retval = _equalAExpr(a, b);