From: Tatsuo Ishii Date: Wed, 25 May 2005 02:17:55 +0000 (+0000) Subject: Fix previous patch to exprTypmod. X-Git-Tag: REL8_0_4~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afc0e843b9618e999bab6030d264b908abffe500;p=thirdparty%2Fpostgresql.git Fix previous patch to exprTypmod. --- diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 44936996508..9082efe7eaf 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.179.4.1 2005/05/24 23:02:54 ishii Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.179.4.2 2005/05/25 02:17:55 ishii Exp $ * *------------------------------------------------------------------------- */ @@ -1492,11 +1492,12 @@ exprTypmod(Node *expr) case BPCHAROID: if (!con->constisnull) { - int32 len = VARSIZE(DatumGetPointer(con->constvalue)); + int32 len = VARSIZE(DatumGetPointer(con->constvalue)) - VARHDRSZ; if (pg_database_encoding_max_length() > 1) len = pg_mbstrlen_with_len(VARDATA(DatumGetPointer(con->constvalue)), len); - return len; + + return len + VARHDRSZ; } break; default: