From 954108f92d5477a4527380c9f867bc9401880975 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 4 Jun 2005 20:56:13 +0000 Subject: [PATCH] Add comment for multi-byte computation. --- src/backend/parser/parse_expr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 19d9306e4e..6d5f21b52e 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.182 2005/05/24 15:45:34 ishii Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.183 2005/06/04 20:56:13 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1556,6 +1556,7 @@ exprTypmod(Node *expr) { int32 len = VARSIZE(DatumGetPointer(con->constvalue)) - VARHDRSZ; + /* if multi-byte, take len and find # characters */ if (pg_database_encoding_max_length() > 1) len = pg_mbstrlen_with_len(VARDATA(DatumGetPointer(con->constvalue)), len); return len + VARHDRSZ;