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

I've fixed up the way domain constraints (not null and type length)

are managed as per request.

Moved from merging with table attributes to applying themselves during
coerce_type() and coerce_type_typmod.

Regression tests altered to test the cast() scenarios.

Rod Taylor
This commit is contained in:
Bruce Momjian
2002-07-06 20:16:36 +00:00
parent 5af6e0a4ac
commit 1666970275
11 changed files with 263 additions and 112 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.102 2002/07/04 15:23:58 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.103 2002/07/06 20:16:35 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -1882,6 +1882,8 @@ expression_tree_walker(Node *node,
return true;
}
break;
case T_Constraint:
return walker(((Constraint *) node)->raw_expr, context);
case T_NullTest:
return walker(((NullTest *) node)->arg, context);
case T_BooleanTest:
@@ -2236,6 +2238,20 @@ expression_tree_mutator(Node *node,
return (Node *) newnode;
}
break;
case T_Constraint:
{
/*
* Used for confirming domains. Only needed fields
* within the executor are the name, raw expression
* and constraint type.
*/
Constraint *con = (Constraint *) node;
Constraint *newnode;
FLATCOPY(newnode, con, Constraint);
MUTATE(newnode->raw_expr, con->raw_expr, Node *);
return (Node *) newnode;
}
case T_NullTest:
{
NullTest *ntest = (NullTest *) node;