]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix previous patch to exprTypmod.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 25 May 2005 02:17:55 +0000 (02:17 +0000)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 25 May 2005 02:17:55 +0000 (02:17 +0000)
src/backend/parser/parse_expr.c

index 4493699650893ecae75cf621e79f4d17fe479a33..9082efe7eaf49943df586373e3ee84141e02be99 100644 (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: