Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
87cfb8eb
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,发现更多精彩内容 >>
提交
87cfb8eb
编写于
8月 10, 2002
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed very stupid but important bug: mixing calls of some founctions from
contrib/tsearch and contrib/ltree :) Teodor Sigaev
上级
be2de3b9
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
21 addition
and
19 deletion
+21
-19
contrib/ltree/README.ltree
contrib/ltree/README.ltree
+3
-1
contrib/ltree/_ltree_gist.c
contrib/ltree/_ltree_gist.c
+3
-3
contrib/ltree/crc32.c
contrib/ltree/crc32.c
+1
-1
contrib/ltree/crc32.h
contrib/ltree/crc32.h
+2
-2
contrib/ltree/ltree.h
contrib/ltree/ltree.h
+1
-1
contrib/ltree/ltree_gist.c
contrib/ltree/ltree_gist.c
+2
-2
contrib/ltree/ltree_io.c
contrib/ltree/ltree_io.c
+1
-1
contrib/ltree/ltxtquery_io.c
contrib/ltree/ltxtquery_io.c
+1
-1
contrib/ltree/ltxtquery_op.c
contrib/ltree/ltxtquery_op.c
+7
-7
未找到文件。
contrib/ltree/README.ltree
浏览文件 @
87cfb8eb
...
...
@@ -426,6 +426,8 @@ appreciate your input. So far, below some (rather obvious) results:
CHANGES
Aug 9, 2002
Fixed very stupid but important bug :-)
July 31, 2002
Now works on 64-bit platforms.
Added function lca - lowest common ancestor
...
...
@@ -437,7 +439,7 @@ July 13, 2002
TODO
* Testing on 64-bit platforms. There are several known problems with byte
alignment;
alignment;
-- RESOLVED
* Better documentation;
* We plan (probably) to improve regular expressions processing using
non-deterministic automata;
...
...
contrib/ltree/_ltree_gist.c
浏览文件 @
87cfb8eb
...
...
@@ -45,7 +45,7 @@ hashing(BITVECP sign, ltree *t) {
int
hash
;
while
(
tlen
>
0
)
{
hash
=
crc32_sz
(
cur
->
name
,
cur
->
len
);
hash
=
ltree_
crc32_sz
(
cur
->
name
,
cur
->
len
);
AHASH
(
sign
,
hash
);
cur
=
LEVEL_NEXT
(
cur
);
tlen
--
;
...
...
@@ -455,7 +455,7 @@ gist_te(ltree_gist *key, ltree* query) {
return
true
;
while
(
qlen
>
0
)
{
hv
=
crc32_sz
(
curq
->
name
,
curq
->
len
);
hv
=
ltree_
crc32_sz
(
curq
->
name
,
curq
->
len
);
if
(
!
GETBIT
(
sign
,
AHASHVAL
(
hv
)
)
)
return
false
;
curq
=
LEVEL_NEXT
(
curq
);
...
...
@@ -475,7 +475,7 @@ gist_qtxt(ltree_gist *key, ltxtquery* query) {
if
(
LTG_ISALLTRUE
(
key
)
)
return
true
;
return
execute
(
return
ltree_
execute
(
GETQUERY
(
query
),
(
void
*
)
LTG_SIGN
(
key
),
false
,
checkcondition_bit
...
...
contrib/ltree/crc32.c
浏览文件 @
87cfb8eb
...
...
@@ -95,7 +95,7 @@ static const unsigned int crc32tab[256] = {
};
unsigned
int
crc32_sz
(
char
*
buf
,
int
size
)
ltree_
crc32_sz
(
char
*
buf
,
int
size
)
{
unsigned
int
crc
=
~
0
;
char
*
p
;
...
...
contrib/ltree/crc32.h
浏览文件 @
87cfb8eb
...
...
@@ -2,9 +2,9 @@
#define _CRC32_H
/* Returns crc32 of data block */
extern
unsigned
int
crc32_sz
(
char
*
buf
,
int
size
);
extern
unsigned
int
ltree_
crc32_sz
(
char
*
buf
,
int
size
);
/* Returns crc32 of null-terminated string */
#define crc32(buf) crc32_sz((buf),strlen(buf))
#define crc32(buf)
ltree_
crc32_sz((buf),strlen(buf))
#endif
contrib/ltree/ltree.h
浏览文件 @
87cfb8eb
...
...
@@ -152,7 +152,7 @@ Datum ltree_textadd(PG_FUNCTION_ARGS);
/* Util function */
Datum
ltree_in
(
PG_FUNCTION_ARGS
);
bool
execute
(
ITEM
*
curitem
,
void
*
checkval
,
bool
ltree_
execute
(
ITEM
*
curitem
,
void
*
checkval
,
bool
calcnot
,
bool
(
*
chkcond
)
(
void
*
checkval
,
ITEM
*
val
));
int
ltree_compare
(
const
ltree
*
a
,
const
ltree
*
b
);
...
...
contrib/ltree/ltree_gist.c
浏览文件 @
87cfb8eb
...
...
@@ -130,7 +130,7 @@ hashing(BITVECP sign, ltree *t) {
int
hash
;
while
(
tlen
>
0
)
{
hash
=
crc32_sz
(
cur
->
name
,
cur
->
len
);
hash
=
ltree_
crc32_sz
(
cur
->
name
,
cur
->
len
);
HASH
(
sign
,
hash
);
cur
=
LEVEL_NEXT
(
cur
);
tlen
--
;
...
...
@@ -511,7 +511,7 @@ gist_qtxt(ltree_gist *key, ltxtquery* query) {
if
(
LTG_ISALLTRUE
(
key
)
)
return
true
;
return
execute
(
return
ltree_
execute
(
GETQUERY
(
query
),
(
void
*
)
LTG_SIGN
(
key
),
false
,
checkcondition_bit
...
...
contrib/ltree/ltree_io.c
浏览文件 @
87cfb8eb
...
...
@@ -333,7 +333,7 @@ lquery_in(PG_FUNCTION_ARGS) {
cur
->
totallen
+=
MAXALIGN
(
LVAR_HDRSIZE
+
lptr
->
len
);
lrptr
->
len
=
lptr
->
len
;
lrptr
->
flag
=
lptr
->
flag
;
lrptr
->
val
=
crc32_sz
((
uint8
*
)
lptr
->
start
,
lptr
->
len
);
lrptr
->
val
=
ltree_
crc32_sz
((
uint8
*
)
lptr
->
start
,
lptr
->
len
);
memcpy
(
lrptr
->
name
,
lptr
->
start
,
lptr
->
len
);
lptr
++
;
lrptr
=
LVAR_NEXT
(
lrptr
);
...
...
contrib/ltree/ltxtquery_io.c
浏览文件 @
87cfb8eb
...
...
@@ -154,7 +154,7 @@ pushval_asis(QPRS_STATE * state, int type, char *strval, int lenval, uint16 flag
if
(
lenval
>
0xffff
)
elog
(
ERROR
,
"Word is too long"
);
pushquery
(
state
,
type
,
crc32_sz
((
uint8
*
)
strval
,
lenval
),
pushquery
(
state
,
type
,
ltree_
crc32_sz
((
uint8
*
)
strval
,
lenval
),
state
->
curop
-
state
->
op
,
lenval
,
flag
);
while
(
state
->
curop
-
state
->
op
+
lenval
+
1
>=
state
->
lenop
)
...
...
contrib/ltree/ltxtquery_op.c
浏览文件 @
87cfb8eb
...
...
@@ -13,23 +13,23 @@ PG_FUNCTION_INFO_V1(ltxtq_rexec);
* check for boolean condition
*/
bool
execute
(
ITEM
*
curitem
,
void
*
checkval
,
bool
calcnot
,
bool
(
*
chkcond
)
(
void
*
checkval
,
ITEM
*
val
))
{
ltree_
execute
(
ITEM
*
curitem
,
void
*
checkval
,
bool
calcnot
,
bool
(
*
chkcond
)
(
void
*
checkval
,
ITEM
*
val
))
{
if
(
curitem
->
type
==
VAL
)
return
(
*
chkcond
)
(
checkval
,
curitem
);
else
if
(
curitem
->
val
==
(
int4
)
'!'
)
{
return
(
calcnot
)
?
((
execute
(
curitem
+
1
,
checkval
,
calcnot
,
chkcond
))
?
false
:
true
)
((
ltree_
execute
(
curitem
+
1
,
checkval
,
calcnot
,
chkcond
))
?
false
:
true
)
:
true
;
}
else
if
(
curitem
->
val
==
(
int4
)
'&'
)
{
if
(
execute
(
curitem
+
curitem
->
left
,
checkval
,
calcnot
,
chkcond
))
return
execute
(
curitem
+
1
,
checkval
,
calcnot
,
chkcond
);
if
(
ltree_
execute
(
curitem
+
curitem
->
left
,
checkval
,
calcnot
,
chkcond
))
return
ltree_
execute
(
curitem
+
1
,
checkval
,
calcnot
,
chkcond
);
else
return
false
;
}
else
{
/* |-operator */
if
(
execute
(
curitem
+
curitem
->
left
,
checkval
,
calcnot
,
chkcond
))
if
(
ltree_
execute
(
curitem
+
curitem
->
left
,
checkval
,
calcnot
,
chkcond
))
return
true
;
else
return
execute
(
curitem
+
1
,
checkval
,
calcnot
,
chkcond
);
return
ltree_
execute
(
curitem
+
1
,
checkval
,
calcnot
,
chkcond
);
}
return
false
;
}
...
...
@@ -76,7 +76,7 @@ ltxtq_exec(PG_FUNCTION_ARGS) {
chkval
.
node
=
val
;
chkval
.
operand
=
GETOPERAND
(
query
);
result
=
execute
(
result
=
ltree_
execute
(
GETQUERY
(
query
),
&
chkval
,
true
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录