Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
75c6c2b6
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,发现更多精彩内容 >>
提交
75c6c2b6
编写于
8月 26, 1997
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Inlined heap_getattr().
上级
20afa04d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
48 addition
and
104 deletion
+48
-104
src/backend/access/common/heaptuple.c
src/backend/access/common/heaptuple.c
+6
-59
src/backend/access/common/heapvalid.c
src/backend/access/common/heapvalid.c
+2
-2
src/backend/access/common/printtup.c
src/backend/access/common/printtup.c
+6
-4
src/backend/access/index/indexam.c
src/backend/access/index/indexam.c
+2
-2
src/backend/executor/execJunk.c
src/backend/executor/execJunk.c
+1
-2
src/backend/executor/nodeUnique.c
src/backend/executor/nodeUnique.c
+1
-2
src/include/access/heapam.h
src/include/access/heapam.h
+26
-3
src/include/access/heaptuple.h
src/include/access/heaptuple.h
+0
-26
src/include/storage/bufpage.h
src/include/storage/bufpage.h
+4
-4
未找到文件。
src/backend/access/common/heaptuple.c
浏览文件 @
75c6c2b6
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.2
0 1997/08/24 23:07:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.2
1 1997/08/26 23:31:20
momjian Exp $
*
* NOTES
* The old interface functions have been converted to macros
...
...
@@ -39,8 +39,6 @@
#define register
#endif
/* !NO_ASSERT_CHECKING && sparc && sunos4 */
static
char
*
heap_getsysattr
(
HeapTuple
tup
,
Buffer
b
,
int
attnum
);
/* ----------------------------------------------------------------
* misc support routines
* ----------------------------------------------------------------
...
...
@@ -337,7 +335,7 @@ heap_sysattrbyval(AttrNumber attno)
* heap_getsysattr
* ----------------
*/
static
char
*
char
*
heap_getsysattr
(
HeapTuple
tup
,
Buffer
b
,
int
attnum
)
{
switch
(
attnum
)
{
...
...
@@ -423,7 +421,6 @@ fastgetattr(HeapTuple tup,
* ----------------
*/
Assert
(
PointerIsValid
(
isnull
));
Assert
(
attnum
>
0
);
/* ----------------
...
...
@@ -435,7 +432,8 @@ fastgetattr(HeapTuple tup,
* ----------------
*/
*
isnull
=
false
;
if
(
isnull
)
*
isnull
=
false
;
if
(
HeapTupleNoNulls
(
tup
))
{
attnum
--
;
...
...
@@ -469,7 +467,8 @@ fastgetattr(HeapTuple tup,
*/
if
(
att_isnull
(
attnum
,
bp
))
{
*
isnull
=
true
;
if
(
isnull
)
*
isnull
=
true
;
return
NULL
;
}
...
...
@@ -659,58 +658,6 @@ fastgetattr(HeapTuple tup,
}
}
/* ----------------
* heap_getattr
*
* Find a particular field in a row represented as a heap tuple.
* We return a pointer into that heap tuple, which points to the
* first byte of the value of the field in question.
*
* If the field in question has a NULL value, we return a null
* pointer and return <*isnull> == true. Otherwise, we return
* <*isnull> == false.
*
* <tup> is the pointer to the heap tuple. <attnum> is the attribute
* number of the column (field) caller wants. <tupleDesc> is a
* pointer to the structure describing the row and all its fields.
* ---------------- */
char
*
heap_getattr
(
HeapTuple
tup
,
Buffer
b
,
int
attnum
,
TupleDesc
tupleDesc
,
bool
*
isnull
)
{
bool
localIsNull
;
/* ----------------
* sanity checks
* ----------------
*/
Assert
(
tup
!=
NULL
);
if
(
!
PointerIsValid
(
isnull
))
isnull
=
&
localIsNull
;
if
(
attnum
>
(
int
)
tup
->
t_natts
)
{
*
isnull
=
true
;
return
((
char
*
)
NULL
);
}
else
if
(
attnum
>
0
)
{
/* ----------------
* take care of user defined attributes
* ----------------
*/
return
fastgetattr
(
tup
,
attnum
,
tupleDesc
,
isnull
);
}
else
{
/* ----------------
* take care of system attributes
* ----------------
*/
*
isnull
=
false
;
return
heap_getsysattr
(
tup
,
b
,
attnum
);
}
}
/* ----------------
* heap_copytuple
*
...
...
src/backend/access/common/heapvalid.c
浏览文件 @
75c6c2b6
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.1
4 1997/08/24 23:07:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.1
5 1997/08/26 23:31:22
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -15,7 +15,7 @@
#include <postgres.h>
#include <fmgr.h>
#include <access/heap
tuple
.h>
#include <access/heap
am
.h>
#include <access/valid.h>
#include <access/xact.h>
#include <storage/bufpage.h>
...
...
src/backend/access/common/printtup.c
浏览文件 @
75c6c2b6
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.1
4 1997/08/18 20:51:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.1
5 1997/08/26 23:31:23
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -17,7 +17,7 @@
#include <postgres.h>
#include <fmgr.h>
#include <access/heap
tuple
.h>
#include <access/heap
am
.h>
#include <access/printtup.h>
#include <catalog/pg_type.h>
#include <libpq/libpq.h>
...
...
@@ -91,7 +91,8 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
j
=
0
;
k
=
1
<<
7
;
for
(
i
=
0
;
i
<
tuple
->
t_natts
;
)
{
attr
=
heap_getattr
(
tuple
,
InvalidBuffer
,
++
i
,
typeinfo
,
&
isnull
);
i
++
;
/* heap_getattr is a macro, so no increment */
attr
=
heap_getattr
(
tuple
,
InvalidBuffer
,
i
,
typeinfo
,
&
isnull
);
if
(
!
isnull
)
j
|=
k
;
k
>>=
1
;
...
...
@@ -214,7 +215,8 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
j
=
0
;
k
=
1
<<
7
;
for
(
i
=
0
;
i
<
tuple
->
t_natts
;
)
{
attr
=
heap_getattr
(
tuple
,
InvalidBuffer
,
++
i
,
typeinfo
,
&
isnull
);
i
++
;
/* heap_getattr is a macro, so no increment */
attr
=
heap_getattr
(
tuple
,
InvalidBuffer
,
i
,
typeinfo
,
&
isnull
);
if
(
!
isnull
)
j
|=
k
;
k
>>=
1
;
...
...
src/backend/access/index/indexam.c
浏览文件 @
75c6c2b6
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.1
2 1997/08/19 21:29:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.1
3 1997/08/26 23:31:28
momjian Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relationId
...
...
@@ -69,7 +69,7 @@
#include <utils/relcache.h>
#include <fmgr.h>
#include <storage/lmgr.h>
#include <access/heap
tuple
.h>
#include <access/heap
am
.h>
/* ----------------
* undefine macros we aren't going to use that would otherwise
...
...
src/backend/executor/execJunk.c
浏览文件 @
75c6c2b6
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.
4 1997/01/10 20:17:25
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.
5 1997/08/26 23:31:37
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -17,7 +17,6 @@
#include "postgres.h"
#include "utils/palloc.h"
#include "access/heaptuple.h"
#include "access/heapam.h"
#include "executor/executor.h"
#include "nodes/relation.h"
...
...
src/backend/executor/nodeUnique.c
浏览文件 @
75c6c2b6
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.
6 1997/01/10 20:17:38
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.
7 1997/08/26 23:31:44
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -31,7 +31,6 @@
#include "executor/nodeUnique.h"
#include "optimizer/clauses.h"
#include "access/heapam.h"
#include "access/heaptuple.h"
#include "access/printtup.h"
/* for typtoout() */
#include "utils/builtins.h"
/* for namecpy()*/
...
...
src/include/access/heapam.h
浏览文件 @
75c6c2b6
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: heapam.h,v 1.
7 1997/08/19 21:37:30
momjian Exp $
* $Id: heapam.h,v 1.
8 1997/08/26 23:31:53
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -78,6 +78,30 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
#define IncrHeapAccessStat(x) \
(heap_access_stats == NULL ? 0 : (heap_access_stats->x)++)
/* ----------------
* heap_getattr
*
* Find a particular field in a row represented as a heap tuple.
* We return a pointer into that heap tuple, which points to the
* first byte of the value of the field in question.
*
* If the field in question has a NULL value, we return a null
* pointer and return <*isnull> == true. Otherwise, we return
* <*isnull> == false.
*
* <tup> is the pointer to the heap tuple. <attnum> is the attribute
* number of the column (field) caller wants. <tupleDesc> is a
* pointer to the structure describing the row and all its fields.
* ---------------- */
#define heap_getattr(tup, b, attnum, tupleDesc, isnull) \
(AssertMacro((tup) != NULL) ? \
((attnum) > (int) (tup)->t_natts) ? \
(((isnull) ? (*(isnull) = true) : NULL), (char *) NULL) : \
((attnum) > 0) ? \
fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \
(((isnull) ? (*(isnull) = false) : NULL), heap_getsysattr((tup), (b), (attnum))) : \
(char *) NULL)
extern
HeapAccessStatistics
heap_access_stats
;
/* in stats.c */
/* ----------------
...
...
@@ -114,10 +138,9 @@ extern void DataFill(char *data, TupleDesc tupleDesc,
extern
int
heap_attisnull
(
HeapTuple
tup
,
int
attnum
);
extern
int
heap_sysattrlen
(
AttrNumber
attno
);
extern
bool
heap_sysattrbyval
(
AttrNumber
attno
);
extern
char
*
heap_getsysattr
(
HeapTuple
tup
,
Buffer
b
,
int
attnum
);
extern
char
*
fastgetattr
(
HeapTuple
tup
,
int
attnum
,
TupleDesc
att
,
bool
*
isnull
);
extern
char
*
heap_getattr
(
HeapTuple
tup
,
Buffer
b
,
int
attnum
,
TupleDesc
att
,
bool
*
isnull
);
extern
HeapTuple
heap_copytuple
(
HeapTuple
tuple
);
extern
HeapTuple
heap_formtuple
(
TupleDesc
tupleDescriptor
,
Datum
value
[],
char
nulls
[]);
...
...
src/include/access/heaptuple.h
已删除
100644 → 0
浏览文件 @
20afa04d
/*-------------------------------------------------------------------------
*
* heaptuple.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: heaptuple.h,v 1.3 1996/11/05 07:18:05 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef HEAPTUPLE_H
#define HEAPTUPLE_H
#include <access/tupdesc.h>
#include <storage/buf.h>
#include <access/htup.h>
extern
char
*
heap_getattr
(
HeapTuple
tup
,
Buffer
b
,
int
attnum
,
TupleDesc
tupleDesc
,
bool
*
isnull
);
#endif
/* HEAP_TUPLE_H */
src/include/storage/bufpage.h
浏览文件 @
75c6c2b6
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: bufpage.h,v 1.
9 1997/08/24 23:08:01
momjian Exp $
* $Id: bufpage.h,v 1.
10 1997/08/26 23:31:58
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -221,7 +221,7 @@ typedef enum {
* Assumes page is locked.
*/
#define PageGetSpecialSize(page) \
((uint16) (PageGetPageSize(page) - ((PageHeader)
page
)->pd_special))
((uint16) (PageGetPageSize(page) - ((PageHeader)
(page)
)->pd_special))
/*
* PageGetSpecialPointer --
...
...
@@ -245,8 +245,8 @@ typedef enum {
*/
#define PageGetItem(page, itemId) \
(AssertMacro(PageIsValid(page)) ? \
AssertMacro(
itemId
->lp_flags & LP_USED) ? \
(Item)(((char *)
page) + itemId
->lp_off) : false : false)
AssertMacro(
(itemId)
->lp_flags & LP_USED) ? \
(Item)(((char *)
(page)) + (itemId)
->lp_off) : false : false)
/*
* BufferGetPageSize --
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录