From 5454eb04567cf04361546f34cc1e7d90a5818160 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Wed, 25 May 2005 02:03:52 +0000 Subject: [PATCH] Fix previous patch to exprTypmod. --- src/backend/parser/parse_expr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 745bc9e7877..9bdee98dafb 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: -- 2.39.5