mirror of
https://github.com/postgres/postgres.git
synced 2026-04-28 17:49:35 -04:00
Fix previous patch to exprTypmod.
This commit is contained in:
parent
2a99455ca7
commit
afc0e843b9
1 changed files with 4 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue