1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-11 00:12:06 +03:00

Preliminary code review for domain CHECK constraints patch: add documentation,

make VALUE a non-reserved word again, use less invasive method of passing
ConstraintTestValue into transformExpr, fix problems with nested constraint
testing, do correct thing with NULL result from a constraint expression,
remove memory leak.  Domain checks still need much more work if we are going
to allow ALTER DOMAIN, however.
This commit is contained in:
Tom Lane
2002-12-12 20:35:16 +00:00
parent ff7349694f
commit b0422b215c
28 changed files with 222 additions and 292 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.116 2002/12/12 15:49:32 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.117 2002/12/12 20:35:12 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -2129,6 +2129,7 @@ expression_tree_walker(Node *node,
case T_Var:
case T_Const:
case T_Param:
case T_ConstraintTestValue:
case T_RangeTblRef:
/* primitive node types with no subnodes */
break;
@@ -2265,8 +2266,6 @@ expression_tree_walker(Node *node,
if (walker(((ConstraintTest *) node)->arg, context))
return true;
return walker(((ConstraintTest *) node)->check_expr, context);
case T_ConstraintTestValue:
break;
case T_TargetEntry:
return walker(((TargetEntry *) node)->expr, context);
case T_Query:
@@ -2474,6 +2473,7 @@ expression_tree_mutator(Node *node,
case T_Var:
case T_Const:
case T_Param:
case T_ConstraintTestValue:
case T_RangeTblRef:
/* primitive node types with no subnodes */
return (Node *) copyObject(node);
@@ -2651,15 +2651,6 @@ expression_tree_mutator(Node *node,
return (Node *) newnode;
}
break;
case T_ConstraintTestValue:
{
ConstraintTestValue *ctest = (ConstraintTestValue *) node;
ConstraintTestValue *newnode;
FLATCOPY(newnode, ctest, ConstraintTestValue);
return (Node *) newnode;
}
break;
case T_TargetEntry:
{
/*