From afc0e843b9618e999bab6030d264b908abffe500 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Wed, 25 May 2005 02:17:55 +0000 Subject: Fix previous patch to exprTypmod. --- src/backend/parser/parse_expr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/backend/parser/parse_expr.c') 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: -- cgit v1.2.3