Commit cfe71771 authored by Tatsuo Ishii's avatar Tatsuo Ishii

char_length()/octet_length for char() type now returns length of

the charcter including trailing blanks.
parent 27fee810
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.56 2000/01/15 02:59:38 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.57 2000/01/23 08:13:34 ishii Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -462,7 +462,7 @@ bpcharlen(char *arg) ...@@ -462,7 +462,7 @@ bpcharlen(char *arg)
if (!PointerIsValid(arg)) if (!PointerIsValid(arg))
elog(ERROR, "Bad (null) char() external representation"); elog(ERROR, "Bad (null) char() external representation");
#ifdef MULTIBYTE #ifdef MULTIBYTE
l = bcTruelen(arg); l = VARSIZE(arg) - VARHDRSZ;
len = 0; len = 0;
s = VARDATA(arg); s = VARDATA(arg);
while (l > 0) while (l > 0)
...@@ -474,7 +474,7 @@ bpcharlen(char *arg) ...@@ -474,7 +474,7 @@ bpcharlen(char *arg)
} }
return (len); return (len);
#else #else
return bcTruelen(arg); return (VARSIZE(arg) - VARHDRSZ);
#endif #endif
} }
...@@ -484,7 +484,7 @@ bpcharoctetlen(char *arg) ...@@ -484,7 +484,7 @@ bpcharoctetlen(char *arg)
if (!PointerIsValid(arg)) if (!PointerIsValid(arg))
elog(ERROR, "Bad (null) char() external representation"); elog(ERROR, "Bad (null) char() external representation");
return bcTruelen(arg); return (VARSIZE(arg) - VARHDRSZ);
} }
bool bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment