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

Commit5ff9899

Browse files
committed
Fix bug "select lower('asd') = 'asd'" returns false with multibyte encoding
and non-C locale. Fix is just to use correct source's length for char2wcharcall.
1 parent13c843d commit5ff9899

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.143 2008/06/23 19:27:19 momjian Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.144 2008/06/26 16:06:37 teodor Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
@@ -1454,7 +1454,7 @@ str_tolower(char *buff, size_t nbytes)
14541454
/* Output workspace cannot have more codes than input bytes */
14551455
workspace= (wchar_t*)palloc((nbytes+1)*sizeof(wchar_t));
14561456

1457-
char2wchar(workspace,nbytes+1,buff,nbytes+1);
1457+
char2wchar(workspace,nbytes+1,buff,nbytes);
14581458

14591459
for (curr_char=0;workspace[curr_char]!=0;curr_char++)
14601460
workspace[curr_char]=towlower(workspace[curr_char]);
@@ -1502,7 +1502,7 @@ str_toupper(char *buff, size_t nbytes)
15021502
/* Output workspace cannot have more codes than input bytes */
15031503
workspace= (wchar_t*)palloc((nbytes+1)*sizeof(wchar_t));
15041504

1505-
char2wchar(workspace,nbytes+1,buff,nbytes+1);
1505+
char2wchar(workspace,nbytes+1,buff,nbytes);
15061506

15071507
for (curr_char=0;workspace[curr_char]!=0;curr_char++)
15081508
workspace[curr_char]=towupper(workspace[curr_char]);
@@ -1551,7 +1551,7 @@ str_initcap(char *buff, size_t nbytes)
15511551
/* Output workspace cannot have more codes than input bytes */
15521552
workspace= (wchar_t*)palloc((nbytes+1)*sizeof(wchar_t));
15531553

1554-
char2wchar(workspace,nbytes+1,buff,nbytes+1);
1554+
char2wchar(workspace,nbytes+1,buff,nbytes);
15551555

15561556
for (curr_char=0;workspace[curr_char]!=0;curr_char++)
15571557
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp