Fix previous patch to exprTypmod.

This commit is contained in:
Tatsuo Ishii 2005-05-25 02:17:55 +00:00
parent 2a99455ca7
commit afc0e843b9

View file

@ -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: