Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e3f2eb1

Browse files
committed
Fix for varchar functions, and indextyple j-1 fix.
1 parent 8203410 commit e3f2eb1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/backend/access/common/indextuple.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.24 1998/02/04 21:32:09 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.25 1998/02/05 17:22:23 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -293,7 +293,7 @@ nocache_index_getattr(IndexTuple tup,
293293
while (att[j]->attcacheoff > 0)
294294
j++;
295295

296-
if (!VARLENA_FIXED_SIZE(att[j]))
296+
if (!VARLENA_FIXED_SIZE(att[j-1]))
297297
off = att[j - 1]->attcacheoff + att[j - 1]->attlen;
298298
else
299299
off = att[j - 1]->attcacheoff + att[j - 1]->atttypmod;

src/backend/parser/parse_expr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.15 1998/02/03 01:53:16 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.16 1998/02/05 17:22:29 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -101,7 +101,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
101101
Value *val = &con->val;
102102

103103
if (con->typename != NULL)
104-
result = parser_typecast(val, con->typename, -1);
104+
result = parser_typecast(val, con->typename, 0);
105105
else
106106
result = (Node *) make_const(val);
107107
break;

src/backend/utils/adt/varchar.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.24 1998/01/16 23:20:34 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.25 1998/02/05 17:22:41 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -60,7 +60,7 @@ bpcharin(char *s, int dummy, int atttypmod)
6060
if (s == NULL)
6161
return ((char *) NULL);
6262

63-
if (atttypmod == -1)
63+
if (atttypmod < 1)
6464
{
6565

6666
/*
@@ -133,7 +133,7 @@ varcharin(char *s, int dummy, int atttypmod)
133133
return ((char *) NULL);
134134

135135
len = strlen(s) + VARHDRSZ;
136-
if (atttypmod != -1 && len > atttypmod)
136+
if (atttypmod > 0 && len > atttypmod)
137137
len = atttypmod; /* clip the string at max length */
138138

139139
if (len > 4096)

0 commit comments

Comments
 (0)