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

Commit1409819

Browse files
committed
Fix for textcat on varchar() fields.
1 parentf4253b0 commit1409819

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.21 1997/09/08 21:48:42 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.22 1997/11/23 21:39:12 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -253,9 +253,14 @@ textcat(text *t1, text *t2)
253253
len1= (PointerIsValid(t1) ? (VARSIZE(t1)-VARHDRSZ) :0);
254254
if (len1<0)
255255
len1=0;
256+
while (len1>0&&VARDATA(t1)[len1-1]=='\0')
257+
len1--;
258+
256259
len2= (PointerIsValid(t2) ? (VARSIZE(t2)-VARHDRSZ) :0);
257260
if (len2<0)
258261
len2=0;
262+
while (len2>0&&VARDATA(t2)[len2-1]=='\0')
263+
len2--;
259264

260265
result=PALLOC(len=len1+len2+VARHDRSZ);
261266

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp