Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
97ec9501
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,发现更多精彩内容 >>
提交
97ec9501
编写于
1月 26, 2006
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update btree_gist for CIDR/INET changes --- there's really no need to
have a separate set of CIDR code here, either.
上级
31253219
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
77 deletion
+17
-77
contrib/btree_gist/btree_gist.sql.in
contrib/btree_gist/btree_gist.sql.in
+6
-16
contrib/btree_gist/btree_inet.c
contrib/btree_gist/btree_inet.c
+11
-61
未找到文件。
contrib/btree_gist/btree_gist.sql.in
浏览文件 @
97ec9501
...
...
@@ -1126,21 +1126,11 @@ RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gbt_cidr_consistent(internal,cidr,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gbt_inet_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gbt_cidr_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gbt_inet_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
...
...
@@ -1183,12 +1173,12 @@ AS
CREATE OPERATOR CLASS gist_cidr_ops
DEFAULT FOR TYPE cidr USING gist
AS
OPERATOR 1 < RECHECK ,
OPERATOR 2 <= RECHECK ,
OPERATOR 3 = RECHECK ,
OPERATOR 4 >= RECHECK ,
OPERATOR 5 > RECHECK ,
FUNCTION 1 gbt_
cidr_consistent (internal, cidr
, int2),
OPERATOR 1 <
(inet, inet)
RECHECK ,
OPERATOR 2 <=
(inet, inet)
RECHECK ,
OPERATOR 3 =
(inet, inet)
RECHECK ,
OPERATOR 4 >=
(inet, inet)
RECHECK ,
OPERATOR 5 >
(inet, inet)
RECHECK ,
FUNCTION 1 gbt_
inet_consistent (internal, inet
, int2),
FUNCTION 2 gbt_inet_union (bytea, internal),
FUNCTION 3 gbt_inet_compress (internal),
FUNCTION 4 gbt_decompress (internal),
...
...
contrib/btree_gist/btree_inet.c
浏览文件 @
97ec9501
...
...
@@ -14,20 +14,16 @@ typedef struct inetkey
** inet ops
*/
PG_FUNCTION_INFO_V1
(
gbt_inet_compress
);
PG_FUNCTION_INFO_V1
(
gbt_cidr_compress
);
PG_FUNCTION_INFO_V1
(
gbt_inet_union
);
PG_FUNCTION_INFO_V1
(
gbt_inet_picksplit
);
PG_FUNCTION_INFO_V1
(
gbt_inet_consistent
);
PG_FUNCTION_INFO_V1
(
gbt_cidr_consistent
);
PG_FUNCTION_INFO_V1
(
gbt_inet_penalty
);
PG_FUNCTION_INFO_V1
(
gbt_inet_same
);
Datum
gbt_inet_compress
(
PG_FUNCTION_ARGS
);
Datum
gbt_cidr_compress
(
PG_FUNCTION_ARGS
);
Datum
gbt_inet_union
(
PG_FUNCTION_ARGS
);
Datum
gbt_inet_picksplit
(
PG_FUNCTION_ARGS
);
Datum
gbt_inet_consistent
(
PG_FUNCTION_ARGS
);
Datum
gbt_cidr_consistent
(
PG_FUNCTION_ARGS
);
Datum
gbt_inet_penalty
(
PG_FUNCTION_ARGS
);
Datum
gbt_inet_same
(
PG_FUNCTION_ARGS
);
...
...
@@ -89,17 +85,18 @@ static const gbtree_ninfo tinfo =
**************************************************/
static
GISTENTRY
*
gbt_inet_compress_inetrnal
(
GISTENTRY
*
retval
,
GISTENTRY
*
entry
,
Oid
typid
)
Datum
gbt_inet_compress
(
PG_FUNCTION_ARGS
)
{
GISTENTRY
*
entry
=
(
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
);
GISTENTRY
*
retval
;
if
(
entry
->
leafkey
)
{
inetKEY
*
r
=
(
inetKEY
*
)
palloc
(
sizeof
(
inetKEY
));
retval
=
palloc
(
sizeof
(
GISTENTRY
));
r
->
lower
=
convert_network_to_scalar
(
entry
->
key
,
typid
);
r
->
lower
=
convert_network_to_scalar
(
entry
->
key
,
INETOID
);
r
->
upper
=
r
->
lower
;
gistentryinit
(
*
retval
,
PointerGetDatum
(
r
),
entry
->
rel
,
entry
->
page
,
...
...
@@ -108,71 +105,24 @@ gbt_inet_compress_inetrnal(GISTENTRY *retval, GISTENTRY *entry, Oid typid)
else
retval
=
entry
;
return
(
retval
);
PG_RETURN_POINTER
(
retval
);
}
Datum
gbt_inet_compress
(
PG_FUNCTION_ARGS
)
{
GISTENTRY
*
entry
=
(
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
);
GISTENTRY
*
retval
=
NULL
;
PG_RETURN_POINTER
(
gbt_inet_compress_inetrnal
(
retval
,
entry
,
INETOID
));
}
Datum
gbt_cidr_compress
(
PG_FUNCTION_ARGS
)
gbt_inet_consistent
(
PG_FUNCTION_ARGS
)
{
GISTENTRY
*
entry
=
(
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
);
GISTENTRY
*
retval
=
NULL
;
PG_RETURN_POINTER
(
gbt_inet_compress_inetrnal
(
retval
,
entry
,
CIDROID
));
}
static
bool
gbt_inet_consistent_internal
(
const
GISTENTRY
*
entry
,
const
double
*
query
,
const
StrategyNumber
*
strategy
)
{
double
query
=
convert_network_to_scalar
(
PG_GETARG_DATUM
(
1
),
INETOID
);
StrategyNumber
strategy
=
(
StrategyNumber
)
PG_GETARG_UINT16
(
2
);
inetKEY
*
kkk
=
(
inetKEY
*
)
DatumGetPointer
(
entry
->
key
);
GBT_NUMKEY_R
key
;
key
.
lower
=
(
GBT_NUMKEY
*
)
&
kkk
->
lower
;
key
.
upper
=
(
GBT_NUMKEY
*
)
&
kkk
->
upper
;
return
(
gbt_num_consistent
(
&
key
,
(
void
*
)
query
,
strategy
,
GIST_LEAF
(
entry
),
&
tinfo
)
);
}
Datum
gbt_inet_consistent
(
PG_FUNCTION_ARGS
)
{
GISTENTRY
*
entry
=
(
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
);
double
query
=
convert_network_to_scalar
(
PG_GETARG_DATUM
(
1
),
INETOID
);
StrategyNumber
strategy
=
(
StrategyNumber
)
PG_GETARG_UINT16
(
2
);
PG_RETURN_BOOL
(
gbt_inet_consistent_internal
(
entry
,
&
query
,
&
strategy
)
);
}
Datum
gbt_cidr_consistent
(
PG_FUNCTION_ARGS
)
{
GISTENTRY
*
entry
=
(
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
);
double
query
=
convert_network_to_scalar
(
PG_GETARG_DATUM
(
1
),
CIDROID
);
StrategyNumber
strategy
=
(
StrategyNumber
)
PG_GETARG_UINT16
(
2
);
PG_RETURN_BOOL
(
gbt_inet_consistent_internal
(
entry
,
&
query
,
&
strategy
)
);
PG_RETURN_BOOL
(
gbt_num_consistent
(
&
key
,
(
void
*
)
&
query
,
&
strategy
,
GIST_LEAF
(
entry
),
&
tinfo
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录