From: Tatsuo Ishii Date: Wed, 25 May 2005 02:03:52 +0000 (+0000) Subject: Fix previous patch to exprTypmod. X-Git-Tag: REL7_3_11~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5454eb04567cf04361546f34cc1e7d90a5818160;p=postgresql Fix previous patch to exprTypmod. --- diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 745bc9e787..9bdee98daf 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.129.2.2 2005/05/24 23:52:02 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.129.2.3 2005/05/25 02:03:52 ishii Exp $ * *------------------------------------------------------------------------- */ @@ -981,11 +981,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: