1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Fix previous patch to exprTypmod.

This commit is contained in:
Tatsuo Ishii
2005-05-25 02:13:48 +00:00
parent de212f4910
commit 05a07afd51

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.163.2.2 2005/05/24 23:15:05 ishii Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.163.2.3 2005/05/25 02:13:48 ishii Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1358,11 +1358,11 @@ exprTypmod(Node *expr)
case BPCHAROID: case BPCHAROID:
if (!con->constisnull) if (!con->constisnull)
{ {
int32 len = VARSIZE(DatumGetPointer(con->constvalue)); int32 len = VARSIZE(DatumGetPointer(con->constvalue)) - VARHDRSZ;
if (pg_database_encoding_max_length() > 1) if (pg_database_encoding_max_length() > 1)
len = pg_mbstrlen_with_len(VARDATA(DatumGetPointer(con->constvalue)), len); len = pg_mbstrlen_with_len(VARDATA(DatumGetPointer(con->constvalue)), len);
return len; return len + VARHDRSZ;
} }
break; break;
default: default: