diff options
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/parser/gram.y | 18 | ||||
| -rw-r--r-- | src/backend/utils/adt/varbit.c | 6 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 0d2461f50d..2ec136afe8 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.183 2000/08/07 06:54:51 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.184 2000/08/07 20:16:13 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -4153,10 +4153,11 @@ Bit: bit '(' Iconst ')' $$ = makeNode(TypeName); $$->name = $1; if ($3 < 1) - elog(ERROR,"length for type '%s' must be at least 1",$1); - else if ($3 > (MaxAttrSize * sizeof(char))) - elog(ERROR,"length for type '%s' cannot exceed %ld",$1, - (MaxAttrSize * sizeof(char))); + elog(ERROR,"length for type '%s' must be at least 1", + $1); + else if ($3 > (MaxAttrSize * BITSPERBYTE)) + elog(ERROR,"length for type '%s' cannot exceed %d", + $1, (MaxAttrSize * BITSPERBYTE)); $$->typmod = $3; } | bit @@ -4187,10 +4188,11 @@ Character: character '(' Iconst ')' $$ = makeNode(TypeName); $$->name = $1; if ($3 < 1) - elog(ERROR,"length for type '%s' must be at least 1",$1); + elog(ERROR,"length for type '%s' must be at least 1", + $1); else if ($3 > MaxAttrSize) - elog(ERROR,"length for type '%s' cannot exceed %ld",$1, - MaxAttrSize); + elog(ERROR,"length for type '%s' cannot exceed %d", + $1, MaxAttrSize); /* we actually implement these like a varlen, so * the first 4 bytes is the length. (the difference diff --git a/src/backend/utils/adt/varbit.c b/src/backend/utils/adt/varbit.c index b238bce531..cba4085bd2 100644 --- a/src/backend/utils/adt/varbit.c +++ b/src/backend/utils/adt/varbit.c @@ -4,7 +4,7 @@ * Functions for the built-in type bit() and varying bit(). * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.6 2000/07/28 02:13:31 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.7 2000/08/07 20:15:37 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -107,7 +107,7 @@ zpbit_in(char *s, int dummy, int32 atttypmod) if (len > MaxAttrSize) elog(ERROR, "zpbit_in: length of bit() must be less than %ld", - (MaxAttrSize - VARHDRSZ - VARBITHDRSZ) * BITSPERBYTE); + (long) ((MaxAttrSize - VARHDRSZ - VARBITHDRSZ) * BITSPERBYTE)); result = (bits8 *) palloc(len); /* set to 0 so that *r is always initialised and strin is zero-padded */ @@ -338,7 +338,7 @@ varbit_in(char *s, int dummy, int32 atttypmod) if (len > MaxAttrSize) elog(ERROR, "varbit_in: length of bit() must be less than %ld", - (MaxAttrSize - VARHDRSZ - VARBITHDRSZ) * BITSPERBYTE); + (long) ((MaxAttrSize - VARHDRSZ - VARBITHDRSZ) * BITSPERBYTE)); result = (bits8 *) palloc(len); /* set to 0 so that *r is always initialised and strin is zero-padded */ |
