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

Commit1561684

Browse files
committed
Compare 'char' and 'text' lexicographically.
1 parent0346ab7 commit1561684

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎src/backend/access/nbtree/nbtcompare.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.9 1997/05/22 00:07:15 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.10 1997/06/11 05:20:05 vadim Exp $
1111
*
1212
* NOTES
1313
*These functions are stored in pg_amproc. For each operator class
@@ -98,7 +98,7 @@ btabstimecmp(AbsoluteTime a, AbsoluteTime b)
9898
int32
9999
btcharcmp(chara,charb)
100100
{
101-
return ((int32) (a-b));
101+
return ((int32) ((uint8)a-(uint8)b));
102102
}
103103

104104
int32
@@ -135,9 +135,9 @@ int32
135135
bttextcmp(structvarlena*a,structvarlena*b)
136136
{
137137
intres;
138+
unsignedchar*ap,*bp;
138139

139140
#ifdefUSE_LOCALE
140-
unsignedchar*ap,*bp;
141141
intla=VARSIZE(a)-VARHDRSZ;
142142
intlb=VARSIZE(b)-VARHDRSZ;
143143

@@ -155,7 +155,6 @@ bttextcmp(struct varlena *a, struct varlena *b)
155155
pfree (bp);
156156

157157
#else
158-
char*ap,*bp;
159158
intlen=VARSIZE(a);
160159

161160
/* len is the length of the shorter of the two strings */
@@ -164,8 +163,8 @@ bttextcmp(struct varlena *a, struct varlena *b)
164163

165164
len-=VARHDRSZ;
166165

167-
ap=VARDATA(a);
168-
bp=VARDATA(b);
166+
ap=(unsignedchar*)VARDATA(a);
167+
bp=(unsignedchar*)VARDATA(b);
169168

170169
/*
171170
* If the two strings differ in the first len bytes, or if they're

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp