]> granicus.if.org Git - postgresql/commitdiff
Fix for varchar functions, and indextyple j-1 fix.
authorBruce Momjian <bruce@momjian.us>
Thu, 5 Feb 1998 17:22:41 +0000 (17:22 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 5 Feb 1998 17:22:41 +0000 (17:22 +0000)
src/backend/access/common/indextuple.c
src/backend/parser/parse_expr.c
src/backend/utils/adt/varchar.c

index 5bb18cd6b8d2442b83f7a20500d8c5cd7376fa22..569fe547bcf1b07194f8d7f3395316baca0a1fd2 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.24 1998/02/04 21:32:09 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.25 1998/02/05 17:22:23 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -293,7 +293,7 @@ nocache_index_getattr(IndexTuple tup,
                while (att[j]->attcacheoff > 0)
                        j++;
 
-               if (!VARLENA_FIXED_SIZE(att[j]))
+               if (!VARLENA_FIXED_SIZE(att[j-1]))
                        off = att[j - 1]->attcacheoff + att[j - 1]->attlen;
                else
                        off = att[j - 1]->attcacheoff + att[j - 1]->atttypmod;
index 6e1e244f5017cf1cde6e066dca34ba9ed8f7680a..6678c791791dc70758b98bd71df2ea6104e9a424 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.15 1998/02/03 01:53:16 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.16 1998/02/05 17:22:29 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -101,7 +101,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
                                Value      *val = &con->val;
 
                                if (con->typename != NULL)
-                                       result = parser_typecast(val, con->typename, -1);
+                                       result = parser_typecast(val, con->typename, 0);
                                else
                                        result = (Node *) make_const(val);
                                break;
index cb17194e252eedbcc5cc96557d5df495ed6d099c..dbfe54e5725a7eb0f3e1ecc87d1715f6bf861147 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.24 1998/01/16 23:20:34 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.25 1998/02/05 17:22:41 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -60,7 +60,7 @@ bpcharin(char *s, int dummy, int atttypmod)
        if (s == NULL)
                return ((char *) NULL);
 
-       if (atttypmod == -1)
+       if (atttypmod 1)
        {
 
                /*
@@ -133,7 +133,7 @@ varcharin(char *s, int dummy, int atttypmod)
                return ((char *) NULL);
 
        len = strlen(s) + VARHDRSZ;
-       if (atttypmod != -1 && len > atttypmod)
+       if (atttypmod > 0 && len > atttypmod)
                len = atttypmod;        /* clip the string at max length */
 
        if (len > 4096)