Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
21e1e664
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,发现更多精彩内容 >>
提交
21e1e664
编写于
11月 14, 2000
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor cleanup of tableOid-related coding.
上级
b0d243e4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
56 deletion
+27
-56
src/backend/access/common/heaptuple.c
src/backend/access/common/heaptuple.c
+16
-42
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam.c
+7
-10
src/include/access/heapam.h
src/include/access/heapam.h
+2
-2
src/include/access/htup.h
src/include/access/htup.h
+2
-2
未找到文件。
src/backend/access/common/heaptuple.c
浏览文件 @
21e1e664
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.6
5 2000/07/04 02:40:56
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.6
6 2000/11/14 21:04:32
tgl Exp $
*
* NOTES
* The old interface functions have been converted to macros
...
...
@@ -275,38 +275,6 @@ heap_sysattrbyval(AttrNumber attno)
return
byval
;
}
#ifdef NOT_USED
/* ----------------
* heap_getsysattr
* ----------------
*/
Datum
heap_getsysattr
(
HeapTuple
tup
,
Buffer
b
,
int
attnum
)
{
switch
(
attnum
)
{
case
TableOidAttributeNumber
:
return
(
Datum
)
&
tup
->
t_tableoid
;
case
SelfItemPointerAttributeNumber
:
return
(
Datum
)
&
tup
->
t_ctid
;
case
ObjectIdAttributeNumber
:
return
(
Datum
)
(
long
)
tup
->
t_oid
;
case
MinTransactionIdAttributeNumber
:
return
(
Datum
)
(
long
)
tup
->
t_xmin
;
case
MinCommandIdAttributeNumber
:
return
(
Datum
)
(
long
)
tup
->
t_cmin
;
case
MaxTransactionIdAttributeNumber
:
return
(
Datum
)
(
long
)
tup
->
t_xmax
;
case
MaxCommandIdAttributeNumber
:
return
(
Datum
)
(
long
)
tup
->
t_cmax
;
default:
elog
(
ERROR
,
"heap_getsysattr: undefined attnum %d"
,
attnum
);
}
return
(
Datum
)
NULL
;
}
#endif
/* ----------------
* nocachegetattr
*
...
...
@@ -563,6 +531,9 @@ nocachegetattr(HeapTuple tuple,
* heap_copytuple
*
* returns a copy of an entire tuple
*
* The HeapTuple struct, tuple header, and tuple data are all allocated
* as a single palloc() block.
* ----------------
*/
HeapTuple
...
...
@@ -576,17 +547,17 @@ heap_copytuple(HeapTuple tuple)
newTuple
=
(
HeapTuple
)
palloc
(
HEAPTUPLESIZE
+
tuple
->
t_len
);
newTuple
->
t_len
=
tuple
->
t_len
;
newTuple
->
t_self
=
tuple
->
t_self
;
newTuple
->
t_tableOid
=
tuple
->
t_tableOid
;
newTuple
->
t_datamcxt
=
CurrentMemoryContext
;
newTuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
newTuple
+
HEAPTUPLESIZE
);
memmove
((
char
*
)
newTuple
->
t_data
,
(
char
*
)
tuple
->
t_data
,
tuple
->
t_len
);
memcpy
((
char
*
)
newTuple
->
t_data
,
(
char
*
)
tuple
->
t_data
,
tuple
->
t_len
);
return
newTuple
;
}
/* ----------------
* heap_copytuple_with_tuple
*
*
returns a copy of an tuple->t_data
*
copy a tuple into a caller-supplied HeapTuple management struct
* ----------------
*/
void
...
...
@@ -600,11 +571,10 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
dest
->
t_len
=
src
->
t_len
;
dest
->
t_self
=
src
->
t_self
;
dest
->
t_tableOid
=
src
->
t_tableOid
;
dest
->
t_datamcxt
=
CurrentMemoryContext
;
dest
->
t_data
=
(
HeapTupleHeader
)
palloc
(
src
->
t_len
);
memmove
((
char
*
)
dest
->
t_data
,
(
char
*
)
src
->
t_data
,
src
->
t_len
);
return
;
memcpy
((
char
*
)
dest
->
t_data
,
(
char
*
)
src
->
t_data
,
src
->
t_len
);
}
#ifdef NOT_USED
...
...
@@ -705,6 +675,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
tuple
->
t_len
=
len
;
ItemPointerSetInvalid
(
&
(
tuple
->
t_self
));
tuple
->
t_tableOid
=
InvalidOid
;
td
->
t_natts
=
numberOfAttributes
;
td
->
t_hoff
=
hoff
;
...
...
@@ -805,6 +776,7 @@ heap_modifytuple(HeapTuple tuple,
newTuple
->
t_data
->
t_infomask
=
infomask
;
newTuple
->
t_data
->
t_natts
=
numberOfAttributes
;
newTuple
->
t_self
=
tuple
->
t_self
;
newTuple
->
t_tableOid
=
tuple
->
t_tableOid
;
return
newTuple
;
}
...
...
@@ -851,17 +823,19 @@ heap_addheader(uint32 natts, /* max domain index */
tuple
->
t_datamcxt
=
CurrentMemoryContext
;
td
=
tuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
tuple
+
HEAPTUPLESIZE
);
MemSet
((
char
*
)
td
,
0
,
len
);
tuple
->
t_len
=
len
;
ItemPointerSetInvalid
(
&
(
tuple
->
t_self
));
tuple
->
t_tableOid
=
InvalidOid
;
MemSet
((
char
*
)
td
,
0
,
len
);
td
->
t_hoff
=
hoff
;
td
->
t_natts
=
natts
;
td
->
t_infomask
=
0
;
td
->
t_infomask
|=
HEAP_XMAX_INVALID
;
if
(
structlen
>
0
)
mem
move
((
char
*
)
td
+
hoff
,
structure
,
(
size_t
)
structlen
);
mem
cpy
((
char
*
)
td
+
hoff
,
structure
,
(
size_t
)
structlen
);
return
tuple
;
}
src/backend/access/heap/heapam.c
浏览文件 @
21e1e664
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.9
3 2000/11/08 22:09:54
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.9
4 2000/11/14 21:04:31
tgl Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -255,9 +255,7 @@ heapgettup(Relation relation,
OffsetNumber
lineoff
;
int
linesleft
;
ItemPointer
tid
=
(
tuple
->
t_data
==
NULL
)
?
(
ItemPointer
)
NULL
:
&
(
tuple
->
t_self
);
tuple
->
tableOid
=
relation
->
rd_id
;
(
ItemPointer
)
NULL
:
&
(
tuple
->
t_self
);
/* ----------------
* increment access statistics
...
...
@@ -294,6 +292,8 @@ heapgettup(Relation relation,
if
(
!
ItemPointerIsValid
(
tid
))
Assert
(
!
PointerIsValid
(
tid
));
tuple
->
t_tableOid
=
relation
->
rd_id
;
/* ----------------
* return null immediately if relation is empty
...
...
@@ -1145,7 +1145,6 @@ heap_fetch(Relation relation,
ItemPointer
tid
=
&
(
tuple
->
t_self
);
OffsetNumber
offnum
;
tuple
->
tableOid
=
relation
->
rd_id
;
/* ----------------
* increment access statistics
* ----------------
...
...
@@ -1193,6 +1192,7 @@ heap_fetch(Relation relation,
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tuple
->
t_len
=
ItemIdGetLength
(
lp
);
tuple
->
t_tableOid
=
relation
->
rd_id
;
/* ----------------
* check time qualification of tid
...
...
@@ -1241,7 +1241,6 @@ heap_get_latest_tid(Relation relation,
bool
invalidBlock
,
linkend
;
tp
.
tableOid
=
relation
->
rd_id
;
/* ----------------
* get the buffer from the relation descriptor
* Note that this does a buffer pin.
...
...
@@ -1333,7 +1332,6 @@ heap_insert(Relation relation, HeapTuple tup)
Buffer
buffer
;
/* increment access statistics */
tup
->
tableOid
=
relation
->
rd_id
;
IncrHeapAccessStat
(
local_insert
);
IncrHeapAccessStat
(
global_insert
);
...
...
@@ -1357,6 +1355,7 @@ heap_insert(Relation relation, HeapTuple tup)
StoreInvalidTransactionId
(
&
(
tup
->
t_data
->
t_xmax
));
tup
->
t_data
->
t_infomask
&=
~
(
HEAP_XACT_MASK
);
tup
->
t_data
->
t_infomask
|=
HEAP_XMAX_INVALID
;
tup
->
t_tableOid
=
relation
->
rd_id
;
#ifdef TUPLE_TOASTER_ACTIVE
/* ----------
...
...
@@ -1420,7 +1419,6 @@ heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid)
Buffer
buffer
;
int
result
;
tp
.
tableOid
=
relation
->
rd_id
;
/* increment access statistics */
IncrHeapAccessStat
(
local_delete
);
IncrHeapAccessStat
(
global_delete
);
...
...
@@ -1440,6 +1438,7 @@ heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid)
tp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tp
.
t_len
=
ItemIdGetLength
(
lp
);
tp
.
t_self
=
*
tid
;
tp
.
t_tableOid
=
relation
->
rd_id
;
l1:
result
=
HeapTupleSatisfiesUpdate
(
&
tp
);
...
...
@@ -1546,7 +1545,6 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
Buffer
buffer
,
newbuf
;
int
result
;
newtup
->
tableOid
=
relation
->
rd_id
;
/* increment access statistics */
IncrHeapAccessStat
(
local_replace
);
IncrHeapAccessStat
(
global_replace
);
...
...
@@ -1733,7 +1731,6 @@ heap_mark4update(Relation relation, HeapTuple tuple, Buffer *buffer)
PageHeader
dp
;
int
result
;
tuple
->
tableOid
=
relation
->
rd_id
;
/* increment access statistics */
IncrHeapAccessStat
(
local_mark4update
);
IncrHeapAccessStat
(
global_mark4update
);
...
...
src/include/access/heapam.h
浏览文件 @
21e1e664
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: heapam.h,v 1.5
6 2000/08/03 19:19:38
tgl Exp $
* $Id: heapam.h,v 1.5
7 2000/11/14 21:04:32
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -191,7 +191,7 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
: \
(((attnum) == TableOidAttributeNumber) ? \
( \
(Datum)((tup)->tableOid) \
(Datum)((tup)->t
_t
ableOid) \
) \
: \
( \
...
...
src/include/access/htup.h
浏览文件 @
21e1e664
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: htup.h,v 1.3
8 2000/11/14 20:47:34
tgl Exp $
* $Id: htup.h,v 1.3
9 2000/11/14 21:04:32
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -188,7 +188,7 @@ typedef struct HeapTupleData
{
uint32
t_len
;
/* length of *t_data */
ItemPointerData
t_self
;
/* SelfItemPointer */
Oid
tableOid
;
/* table the tuple came from */
Oid
t
_t
ableOid
;
/* table the tuple came from */
MemoryContext
t_datamcxt
;
/* mcxt in which allocated */
HeapTupleHeader
t_data
;
/* -> tuple header and data */
}
HeapTupleData
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录