Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
a9118fc5
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a9118fc5
编写于
8月 26, 2005
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The idea of using _strncoll() on Windows doesn't work. Revert to same
code as we use on other platforms when encoding is not UTF8.
上级
396526d8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
37 deletion
+30
-37
src/backend/utils/adt/varlena.c
src/backend/utils/adt/varlena.c
+30
-37
未找到文件。
src/backend/utils/adt/varlena.c
浏览文件 @
a9118fc5
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.13
2 2005/08/24 17:50:00
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.13
3 2005/08/26 17:40:36
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -840,40 +840,22 @@ varstr_cmp(char *arg1, int len1, char *arg2, int len2)
* C. We also try to optimize relatively-short strings by avoiding
* palloc/pfree overhead.
*/
if
(
lc_collate_is_c
())
{
result
=
strncmp
(
arg1
,
arg2
,
Min
(
len1
,
len2
));
if
((
result
==
0
)
&&
(
len1
!=
len2
))
result
=
(
len1
<
len2
)
?
-
1
:
1
;
}
else
{
#define STACKBUFLEN 1024
if
(
!
lc_collate_is_c
())
{
char
a1buf
[
STACKBUFLEN
];
char
a2buf
[
STACKBUFLEN
];
char
*
a1p
,
*
a2p
;
#ifndef WIN32
if
(
len1
>=
STACKBUFLEN
)
a1p
=
(
char
*
)
palloc
(
len1
+
1
);
else
a1p
=
a1buf
;
if
(
len2
>=
STACKBUFLEN
)
a2p
=
(
char
*
)
palloc
(
len2
+
1
);
else
a2p
=
a2buf
;
memcpy
(
a1p
,
arg1
,
len1
);
a1p
[
len1
]
=
'\0'
;
memcpy
(
a2p
,
arg2
,
len2
);
a2p
[
len2
]
=
'\0'
;
result
=
strcoll
(
a1p
,
a2p
);
if
(
a1p
!=
a1buf
)
pfree
(
a1p
);
if
(
a2p
!=
a2buf
)
pfree
(
a2p
);
#else
/* WIN32 */
#ifdef WIN32
/* Win32 does not have UTF-8, so we need to map to UTF-16 */
if
(
GetDatabaseEncoding
()
==
PG_UTF8
)
{
...
...
@@ -943,17 +925,28 @@ varstr_cmp(char *arg1, int len1, char *arg2, int len2)
return
result
;
}
#endif
/* WIN32 */
/* Win32 has strncoll(), so use it to avoid copying */
return
_strncoll
(
arg1
,
arg2
,
Min
(
len1
,
len2
));
if
(
len1
>=
STACKBUFLEN
)
a1p
=
(
char
*
)
palloc
(
len1
+
1
);
else
a1p
=
a1buf
;
if
(
len2
>=
STACKBUFLEN
)
a2p
=
(
char
*
)
palloc
(
len2
+
1
);
else
a2p
=
a2buf
;
#endif
/* WIN32 */
}
else
{
result
=
strncmp
(
arg1
,
arg2
,
Min
(
len1
,
len2
));
if
((
result
==
0
)
&&
(
len1
!=
len2
))
result
=
(
len1
<
len2
)
?
-
1
:
1
;
memcpy
(
a1p
,
arg1
,
len1
);
a1p
[
len1
]
=
'\0'
;
memcpy
(
a2p
,
arg2
,
len2
);
a2p
[
len2
]
=
'\0'
;
result
=
strcoll
(
a1p
,
a2p
);
if
(
a1p
!=
a1buf
)
pfree
(
a1p
);
if
(
a2p
!=
a2buf
)
pfree
(
a2p
);
}
return
result
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录