]> granicus.if.org Git - postgresql/commitdiff
Fix for constbyval .
authorBruce Momjian <bruce@momjian.us>
Thu, 1 Oct 1998 22:45:32 +0000 (22:45 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 1 Oct 1998 22:45:32 +0000 (22:45 +0000)
src/backend/commands/creatinh.c
src/backend/parser/parse_coerce.c
src/backend/parser/parse_node.c

index ae4495655d84287146fdc9534b4e0cf2c085e5ff..8338be3039f0d4670033ad432fc23060ef947091 100644 (file)
@@ -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] == '$')
index 005aadce8d118f75ae26d343c34c5035b21bac35..d91de78565970c3f29fcb6fbce1808d523a7fd9a 100644 (file)
@@ -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;
                        }
index fe66e3e1c967992ddf4156b278c71681386f26d2..19562927e4a3d5ff15d50541fa317d29ca73c085 100644 (file)
@@ -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
        {