aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-02-05 17:22:41 +0000
committerBruce Momjian <bruce@momjian.us>1998-02-05 17:22:41 +0000
commite3f2eb1f398041645817f5abeb1d695547a7cf92 (patch)
treec4224bd853ce49063aaf3fa443c592fe44c8773d /src
parent82034103ed3025862c813f1dfc35f584d02194e1 (diff)
downloadpostgresql-e3f2eb1f398041645817f5abeb1d695547a7cf92.tar.gz
postgresql-e3f2eb1f398041645817f5abeb1d695547a7cf92.zip
Fix for varchar functions, and indextyple j-1 fix.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/common/indextuple.c4
-rw-r--r--src/backend/parser/parse_expr.c4
-rw-r--r--src/backend/utils/adt/varchar.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c
index 5bb18cd6b8d..569fe547bcf 100644
--- a/src/backend/access/common/indextuple.c
+++ b/src/backend/access/common/indextuple.c
@@ -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;
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 6e1e244f501..6678c791791 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -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;
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c
index cb17194e252..dbfe54e5725 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -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)