Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
f3e9cf9c
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,发现更多精彩内容 >>
提交
f3e9cf9c
编写于
9月 15, 1997
作者:
V
Vadim B. Mikheev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix pfree problem.
上级
feb78cda
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
35 deletion
+13
-35
src/backend/executor/nodeSort.c
src/backend/executor/nodeSort.c
+4
-25
src/backend/utils/sort/psort.c
src/backend/utils/sort/psort.c
+7
-8
src/include/utils/psort.h
src/include/utils/psort.h
+2
-2
未找到文件。
src/backend/executor/nodeSort.c
浏览文件 @
f3e9cf9c
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.
9 1997/09/08 21:43:19 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.
10 1997/09/15 14:27:37 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -112,6 +112,7 @@ ExecSort(Sort *node)
ScanKey
sortkeys
;
HeapTuple
heapTuple
;
TupleTableSlot
*
slot
;
bool
should_free
;
/* ----------------
* get state info from node
...
...
@@ -171,12 +172,7 @@ ExecSort(Sort *node)
* ----------------
*/
slot
=
(
TupleTableSlot
*
)
sortstate
->
csstate
.
cstate
.
cs_ResultTupleSlot
;
/* *** get_cs_ResultTupleSlot((CommonState) sortstate); */
slot
->
ttc_tupleDescriptor
=
ExecGetTupType
(
outerNode
);
#if 0
slot->ttc_execTupDescriptor = ExecGetExecTupDesc(outerNode);
#endif
/* ----------------
* finally set the sorted flag to true
* ----------------
...
...
@@ -198,26 +194,9 @@ ExecSort(Sort *node)
* at this point we grab a tuple from psort
* ----------------
*/
heapTuple
=
psort_grabtuple
(
node
);
if
(
heapTuple
==
NULL
)
{
/* psort_end(node); */
return
(
ExecClearTuple
(
slot
));
}
heapTuple
=
psort_grabtuple
(
node
,
&
should_free
);
ExecStoreTuple
(
heapTuple
,
/* tuple to store */
slot
,
/* slot to store in */
InvalidBuffer
,
/* no buffer */
true
);
/* free the palloc'd tuple */
/* printf("ExecSort: (%x)",node);print_slot(slot);printf("\n");*/
return
slot
;
#if 0
return ExecStoreTuple(heapTuple, /* tuple to store */
slot, /* slot to store in */
InvalidBuffer, /* no buffer */
true);/* free the palloc'd tuple */
#endif
return
(
ExecStoreTuple
(
heapTuple
,
slot
,
InvalidBuffer
,
should_free
));
}
/* ----------------------------------------------------------------
...
...
src/backend/utils/sort/psort.c
浏览文件 @
f3e9cf9c
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.2
1 1997/09/08 21:49:33 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.2
2 1997/09/15 14:28:42 vadim
Exp $
*
* NOTES
* Sorts the first relation into the second relation.
...
...
@@ -128,8 +128,6 @@ psort_begin(Sort *node, int nkeys, ScanKey key)
bool
empty
;
/* to answer: is child node empty? */
node
->
psortstate
=
(
struct
Psortstate
*
)
palloc
(
sizeof
(
struct
Psortstate
));
if
(
node
->
psortstate
==
NULL
)
return
false
;
AssertArg
(
nkeys
>=
1
);
AssertArg
(
key
[
0
].
sk_attno
!=
0
);
...
...
@@ -648,7 +646,7 @@ dumptuples(FILE *file, Sort *node)
* a NULL indicating the last tuple has been processed.
*/
HeapTuple
psort_grabtuple
(
Sort
*
node
)
psort_grabtuple
(
Sort
*
node
,
bool
*
should_free
)
{
register
HeapTuple
tup
;
long
tuplen
;
...
...
@@ -668,7 +666,7 @@ psort_grabtuple(Sort *node)
/* Update current merged sort file position */
PS
(
node
)
->
psort_current
+=
tuplen
;
*
should_free
=
true
;
return
tup
;
}
else
...
...
@@ -680,7 +678,10 @@ psort_grabtuple(Sort *node)
else
{
if
(
PS
(
node
)
->
psort_current
<
PS
(
node
)
->
tupcount
)
return
PS
(
node
)
->
memtuples
[
PS
(
node
)
->
psort_current
++
];
{
*
should_free
=
false
;
return
(
PS
(
node
)
->
memtuples
[
PS
(
node
)
->
psort_current
++
]);
}
else
return
NULL
;
}
...
...
@@ -725,8 +726,6 @@ psort_end(Sort *node)
if
(
!
node
->
cleaned
)
{
Assert
(
node
!=
(
Sort
*
)
NULL
);
/* Assert(PS(node) != (Psortstate *) NULL); */
/*
* I'm changing this because if we are sorting a relation with no
* tuples, psortstate is NULL.
...
...
src/include/utils/psort.h
浏览文件 @
f3e9cf9c
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: psort.h,v 1.1
0 1997/09/08 21:55:14 momjian
Exp $
* $Id: psort.h,v 1.1
1 1997/09/15 14:29:01 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -99,7 +99,7 @@ if (1) CODE; else
/* psort.c */
extern
bool
psort_begin
(
Sort
*
node
,
int
nkeys
,
ScanKey
key
);
extern
HeapTuple
psort_grabtuple
(
Sort
*
node
);
extern
HeapTuple
psort_grabtuple
(
Sort
*
node
,
bool
*
should_free
);
extern
void
psort_markpos
(
Sort
*
node
);
extern
void
psort_restorepos
(
Sort
*
node
);
extern
void
psort_end
(
Sort
*
node
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录