mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
Fix for constbyval .
This commit is contained in:
parent
2074b5f1ad
commit
33572dd7ed
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.34 1998/09/01 04:27:49 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.35 1998/10/01 22:45:29 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -332,8 +332,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
||||
|
||||
for (i = 0; i < constr->num_check; i++)
|
||||
{
|
||||
Constraint *cdef = (Constraint *) makeNode(Constraint); /* palloc(sizeof(Constrai
|
||||
* nt)); */
|
||||
Constraint *cdef = (Constraint *) makeNode(Constraint);
|
||||
|
||||
cdef->contype = CONSTR_CHECK;
|
||||
if (check[i].ccname[0] == '$')
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.6 1998/09/01 04:30:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.7 1998/10/01 22:45:30 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -99,8 +99,7 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
|
||||
{
|
||||
Const *con = (Const *) node;
|
||||
|
||||
val = (Datum) textout((struct varlena *)
|
||||
con->constvalue);
|
||||
val = (Datum) textout((struct varlena *)con->constvalue);
|
||||
infunc = typeidInfunc(targetTypeId);
|
||||
con = makeNode(Const);
|
||||
con->consttype = targetTypeId;
|
||||
@ -109,10 +108,10 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
|
||||
/* use "-1" for varchar() type */
|
||||
con->constvalue = (Datum) fmgr(infunc,
|
||||
val,
|
||||
typeidTypElem(targetTypeId),
|
||||
typeidTypElem(targetTypeId),
|
||||
-1);
|
||||
con->constisnull = false;
|
||||
con->constbyval = true;
|
||||
con->constbyval = typeByVal(typeidType(targetTypeId));
|
||||
con->constisset = false;
|
||||
result = (Node *) con;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.22 1998/09/25 13:36:05 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.23 1998/10/01 22:45:32 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -79,7 +79,6 @@ make_operand(char *opname,
|
||||
result = coerce_type(NULL, tree, orig_typeId, true_typeId);
|
||||
}
|
||||
}
|
||||
|
||||
/* otherwise, this is a NULL value */
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user