Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
8d77c1a8
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,发现更多精彩内容 >>
提交
8d77c1a8
编写于
7月 23, 2000
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up some sloppy casts --- Oid vs. Datum, that sort of thing.
上级
e4e6459c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
50 deletion
+28
-50
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/lsyscache.c
+28
-50
未找到文件。
src/backend/utils/cache/lsyscache.c
浏览文件 @
8d77c1a8
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.4
3 2000/07/02 22:00:48 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.4
4 2000/07/23 03:50:26 tgl
Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
...
...
@@ -24,11 +24,10 @@
/* ---------- AMOP CACHES ---------- */
/*
* op_class
-
* op_class
*
* Return t iff operator 'opid' is in operator class 'opclass' for
* access method 'amopid'.
*
*/
bool
op_class
(
Oid
opid
,
Oid
opclass
,
Oid
amopid
)
...
...
@@ -46,11 +45,10 @@ op_class(Oid opid, Oid opclass, Oid amopid)
/* ---------- ATTRIBUTE CACHES ---------- */
/*
* get_attname
-
* get_attname
*
* Given the relation id and the attribute number,
* return the "attname" field from the attribute relation.
*
*/
char
*
get_attname
(
Oid
relid
,
AttrNumber
attnum
)
...
...
@@ -59,7 +57,7 @@ get_attname(Oid relid, AttrNumber attnum)
tp
=
SearchSysCacheTuple
(
ATTNUM
,
ObjectIdGetDatum
(
relid
),
U
Int16GetDatum
(
attnum
),
Int16GetDatum
(
attnum
),
0
,
0
);
if
(
HeapTupleIsValid
(
tp
))
{
...
...
@@ -72,11 +70,10 @@ get_attname(Oid relid, AttrNumber attnum)
}
/*
* get_attnum
-
* get_attnum
*
* Given the relation id and the attribute name,
* return the "attnum" field from the attribute relation.
*
*/
AttrNumber
get_attnum
(
Oid
relid
,
char
*
attname
)
...
...
@@ -98,11 +95,10 @@ get_attnum(Oid relid, char *attname)
}
/*
* get_atttype
-
* get_atttype
*
* Given the relation OID and the attribute number with the relation,
* return the attribute type OID.
*
*/
Oid
get_atttype
(
Oid
relid
,
AttrNumber
attnum
)
...
...
@@ -111,7 +107,7 @@ get_atttype(Oid relid, AttrNumber attnum)
tp
=
SearchSysCacheTuple
(
ATTNUM
,
ObjectIdGetDatum
(
relid
),
U
Int16GetDatum
(
attnum
),
Int16GetDatum
(
attnum
),
0
,
0
);
if
(
HeapTupleIsValid
(
tp
))
{
...
...
@@ -147,11 +143,10 @@ get_attisset(Oid relid, char *attname)
}
/*
* get_atttypmod
-
* get_atttypmod
*
* Given the relation id and the attribute number,
* return the "atttypmod" field from the attribute relation.
*
*/
int32
get_atttypmod
(
Oid
relid
,
AttrNumber
attnum
)
...
...
@@ -160,7 +155,7 @@ get_atttypmod(Oid relid, AttrNumber attnum)
tp
=
SearchSysCacheTuple
(
ATTNUM
,
ObjectIdGetDatum
(
relid
),
U
Int16GetDatum
(
attnum
),
Int16GetDatum
(
attnum
),
0
,
0
);
if
(
HeapTupleIsValid
(
tp
))
{
...
...
@@ -272,11 +267,10 @@ get_attdisbursion(Oid relid, AttrNumber attnum, double min_estimate)
/* ---------- OPERATOR CACHE ---------- */
/*
* get_opcode
-
* get_opcode
*
* Returns the regproc id of the routine used to implement an
* operator given the operator oid.
*
*/
RegProcedure
get_opcode
(
Oid
opno
)
...
...
@@ -297,7 +291,7 @@ get_opcode(Oid opno)
}
/*
* get_opname
-
* get_opname
* returns the name of the operator with the given opno
*
* Note: returns a palloc'd copy of the string, or NULL if no such operator.
...
...
@@ -321,11 +315,10 @@ get_opname(Oid opno)
}
/*
* op_mergejoinable
-
* op_mergejoinable
*
* Returns the left and right sort operators and types corresponding to a
* mergejoinable operator, or nil if the operator is not mergejoinable.
*
*/
bool
op_mergejoinable
(
Oid
opno
,
Oid
ltype
,
Oid
rtype
,
Oid
*
leftOp
,
Oid
*
rightOp
)
...
...
@@ -344,8 +337,8 @@ op_mergejoinable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
optup
->
oprleft
==
ltype
&&
optup
->
oprright
==
rtype
)
{
*
leftOp
=
ObjectIdGetDatum
(
optup
->
oprlsortop
)
;
*
rightOp
=
ObjectIdGetDatum
(
optup
->
oprrsortop
)
;
*
leftOp
=
optup
->
oprlsortop
;
*
rightOp
=
optup
->
oprrsortop
;
return
true
;
}
}
...
...
@@ -356,8 +349,7 @@ op_mergejoinable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
* op_hashjoinable
*
* Returns the hash operator corresponding to a hashjoinable operator,
* or nil if the operator is not hashjoinable.
*
* or InvalidOid if the operator is not hashjoinable.
*/
Oid
op_hashjoinable
(
Oid
opno
,
Oid
ltype
,
Oid
rtype
)
...
...
@@ -393,10 +385,9 @@ get_operator_tuple(Oid opno)
}
/*
* get_commutator
-
* get_commutator
*
* Returns the corresponding commutator of an operator.
*
*/
Oid
get_commutator
(
Oid
opno
)
...
...
@@ -417,10 +408,9 @@ get_commutator(Oid opno)
}
/*
* get_negator
-
* get_negator
*
* Returns the corresponding negator of an operator.
*
*/
Oid
get_negator
(
Oid
opno
)
...
...
@@ -441,10 +431,9 @@ get_negator(Oid opno)
}
/*
* get_oprrest
-
* get_oprrest
*
* Returns procedure id for computing selectivity of an operator.
*
*/
RegProcedure
get_oprrest
(
Oid
opno
)
...
...
@@ -465,10 +454,9 @@ get_oprrest(Oid opno)
}
/*
* get_oprjoin
-
* get_oprjoin
*
* Returns procedure id for computing selectivity of a join.
*
*/
RegProcedure
get_oprjoin
(
Oid
opno
)
...
...
@@ -498,29 +486,23 @@ Oid
get_func_rettype
(
Oid
funcid
)
{
HeapTuple
func_tuple
;
Oid
funcrettype
;
func_tuple
=
SearchSysCacheTuple
(
PROCOID
,
ObjectIdGetDatum
(
funcid
),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
func_tuple
))
elog
(
ERROR
,
"Function OID %u does not exist"
,
funcid
);
funcrettype
=
(
Oid
)
((
Form_pg_proc
)
GETSTRUCT
(
func_tuple
))
->
prorettype
;
return
funcrettype
;
return
((
Form_pg_proc
)
GETSTRUCT
(
func_tuple
))
->
prorettype
;
}
/* ---------- RELATION CACHE ---------- */
#ifdef NOT_USED
/*
* get_relnatts
-
* get_relnatts
*
* Returns the number of attributes for a given relation.
*
*/
int
get_relnatts
(
Oid
relid
)
...
...
@@ -542,10 +524,9 @@ get_relnatts(Oid relid)
#endif
/*
* get_rel_name
-
* get_rel_name
*
* Returns the name of a given relation.
*
*/
char
*
get_rel_name
(
Oid
relid
)
...
...
@@ -568,10 +549,9 @@ get_rel_name(Oid relid)
/* ---------- TYPE CACHE ---------- */
/*
* get_typlen
-
* get_typlen
*
* Given the type OID, return the length of the type.
*
*/
int16
get_typlen
(
Oid
typid
)
...
...
@@ -592,11 +572,10 @@ get_typlen(Oid typid)
}
/*
* get_typbyval
-
* get_typbyval
*
* Given the type OID, determine whether the type is returned by value or
* not. Returns 1 if by value, 0 if by reference.
*
* not. Returns true if by value, false if by reference.
*/
bool
get_typbyval
(
Oid
typid
)
...
...
@@ -610,7 +589,7 @@ get_typbyval(Oid typid)
{
Form_pg_type
typtup
=
(
Form_pg_type
)
GETSTRUCT
(
tp
);
return
(
bool
)
typtup
->
typbyval
;
return
typtup
->
typbyval
;
}
else
return
false
;
...
...
@@ -638,7 +617,7 @@ get_typalign(Oid typid)
#endif
/*
* get_typdefault
-
* get_typdefault
*
* Given a type OID, return the typdefault field associated with that
* type, or Datum(NULL) if there is no typdefault. (This implies
...
...
@@ -744,12 +723,11 @@ get_typdefault(Oid typid)
}
/*
* get_typtype
-
* get_typtype
*
* Given the type OID, find if it is a basic type, a named relation
* or the generic type 'relation'.
* It returns the null char if the cache lookup fails...
*
*/
#ifdef NOT_USED
char
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录