Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
04abb541
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,发现更多精彩内容 >>
提交
04abb541
编写于
9月 09, 1998
作者:
V
Vadim B. Mikheev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix for indexing problem (?): heap tuple was pfree-d before CatalogIndexInsert()...
上级
b5ed4be2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
14 deletion
+21
-14
src/backend/catalog/index.c
src/backend/catalog/index.c
+21
-14
未找到文件。
src/backend/catalog/index.c
浏览文件 @
04abb541
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.6
1 1998/09/07 05:35:37 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.6
2 1998/09/09 03:42:52 vadim
Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -64,7 +64,8 @@
#define NTUPLES_PER_PAGE(natts) (BLCKSZ/((natts)*AVG_TUPLE_SIZE))
/* non-export function prototypes */
static
Oid
RelationNameGetObjectId
(
char
*
relationName
,
Relation
pg_class
);
static
Oid
RelationNameGetObjectId
(
char
*
relationName
,
Relation
pg_class
);
static
Oid
GetHeapRelationOid
(
char
*
heapRelationName
,
char
*
indexRelationName
);
static
TupleDesc
BuildFuncTupleDesc
(
FuncIndexInfo
*
funcInfo
);
static
TupleDesc
ConstructTupleDescriptor
(
Oid
heapoid
,
Relation
heapRelation
,
...
...
@@ -72,11 +73,12 @@ static TupleDesc ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
int
numatts
,
AttrNumber
*
attNums
);
static
void
ConstructIndexReldesc
(
Relation
indexRelation
,
Oid
amoid
);
static
Oid
UpdateRelationRelation
(
Relation
indexRelation
);
static
Oid
UpdateRelationRelation
(
Relation
indexRelation
);
static
void
InitializeAttributeOids
(
Relation
indexRelation
,
int
numatts
,
Oid
indexoid
);
static
void
AppendAttributeTuples
(
Relation
indexRelation
,
int
numatts
);
static
void
AppendAttributeTuples
(
Relation
indexRelation
,
int
numatts
);
static
void
UpdateIndexRelation
(
Oid
indexoid
,
Oid
heapoid
,
FuncIndexInfo
*
funcInfo
,
int
natts
,
AttrNumber
*
attNums
,
Oid
*
classOids
,
Node
*
predicate
,
...
...
@@ -550,9 +552,11 @@ UpdateRelationRelation(Relation indexRelation)
sizeof
(
*
indexRelation
->
rd_rel
),
(
char
*
)
indexRelation
->
rd_rel
);
/*
* The new tuple must have the same oid as the heap_create() we just
* did.
/* ----------------
* the new tuple must have the same oid as the relcache entry for the
* index. sure would be embarassing to do this sort of thing in polite
* company.
* ----------------
*/
tuple
->
t_oid
=
RelationGetRelid
(
indexRelation
);
heap_insert
(
pg_class
,
tuple
);
...
...
@@ -1074,7 +1078,7 @@ index_create(char *heapRelationName,
/* ----------------
* add index to catalogs
* (
INSERT pg_class
tuple)
* (
append RELATION
tuple)
* ----------------
*/
indexoid
=
UpdateRelationRelation
(
indexRelation
);
...
...
@@ -1260,7 +1264,8 @@ FormIndexDatum(int numberOfAttributes,
char
*
nullv
,
FuncIndexInfoPtr
fInfo
)
{
AttrNumber
attOff
;
AttrNumber
i
;
int
offset
;
bool
isNull
;
/* ----------------
...
...
@@ -1270,16 +1275,18 @@ FormIndexDatum(int numberOfAttributes,
* ----------------
*/
for
(
attOff
=
0
;
attOff
<
numberOfAttributes
;
attOff
++
)
for
(
i
=
1
;
i
<=
numberOfAttributes
;
i
++
)
{
datum
[
attOff
]
=
PointerGetDatum
(
GetIndexValue
(
heapTuple
,
offset
=
AttrNumberGetAttrOffset
(
i
);
datum
[
offset
]
=
PointerGetDatum
(
GetIndexValue
(
heapTuple
,
heapDescriptor
,
attOff
,
offset
,
attributeNumber
,
fInfo
,
&
isNull
));
nullv
[
attOff
]
=
(
isNull
)
?
'n'
:
' '
;
nullv
[
offset
]
=
(
isNull
)
?
'n'
:
' '
;
}
}
...
...
@@ -1417,10 +1424,10 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
newtup
=
heap_modifytuple
(
tuple
,
pg_class
,
values
,
nulls
,
replace
);
heap_replace
(
pg_class
,
&
tuple
->
t_ctid
,
newtup
);
pfree
(
newtup
);
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
idescs
);
CatalogIndexInsert
(
idescs
,
Num_pg_class_indices
,
pg_class
,
newtup
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
pfree
(
newtup
);
}
if
(
!
IsBootstrapProcessingMode
())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录