Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcfe7177

Browse files
committed
char_length()/octet_length for char() type now returns length of
the charcter including trailing blanks.
1 parent27fee81 commitcfe7177

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/utils/adt/varchar.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.56 2000/01/15 02:59:38 petere Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.57 2000/01/23 08:13:34 ishii Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -462,7 +462,7 @@ bpcharlen(char *arg)
462462
if (!PointerIsValid(arg))
463463
elog(ERROR,"Bad (null) char() external representation");
464464
#ifdefMULTIBYTE
465-
l=bcTruelen(arg);
465+
l=VARSIZE(arg)-VARHDRSZ;
466466
len=0;
467467
s=VARDATA(arg);
468468
while (l>0)
@@ -474,7 +474,7 @@ bpcharlen(char *arg)
474474
}
475475
return (len);
476476
#else
477-
returnbcTruelen(arg);
477+
return(VARSIZE(arg)-VARHDRSZ);
478478
#endif
479479
}
480480

@@ -484,7 +484,7 @@ bpcharoctetlen(char *arg)
484484
if (!PointerIsValid(arg))
485485
elog(ERROR,"Bad (null) char() external representation");
486486

487-
returnbcTruelen(arg);
487+
return(VARSIZE(arg)-VARHDRSZ);
488488
}
489489

490490
bool

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp