Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
419b91c0
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,发现更多精彩内容 >>
提交
419b91c0
编写于
3月 21, 1999
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Correct some comments, fix a small memory wastage when datatype
is pass-by-value.
上级
beb1851d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
12 deletion
+15
-12
src/backend/executor/nodeAgg.c
src/backend/executor/nodeAgg.c
+15
-12
未找到文件。
src/backend/executor/nodeAgg.c
浏览文件 @
419b91c0
...
...
@@ -67,10 +67,14 @@ static Datum aggGetAttr(TupleTableSlot *tuple, Aggref *aggref, bool *isNull);
* value1[i] = initcond1
* value2[i] = initcond2
* forall tuples do
* value1[i] = sfunc1(
aggregate_attribute, value1[i]
)
* value1[i] = sfunc1(
value1[i], aggregated_value
)
* value2[i] = sfunc2(value2[i])
* value1[i] = finalfunc(value1[i], value2[i])
*
* If initcond1 is NULL then the first non-NULL aggregated_value is
* assigned directly to value1[i]. sfunc1 isn't applied until value1[i]
* is non-NULL.
*
* If the outer subplan is a Group node, ExecAgg returns as many tuples
* as there are groups.
*
...
...
@@ -272,7 +276,6 @@ ExecAgg(Agg *node)
{
Aggref
*
aggref
=
lfirst
(
alist
);
AttrNumber
attnum
;
int2
attlen
=
0
;
Datum
newVal
=
(
Datum
)
NULL
;
AggFuncInfo
*
aggfns
=
&
aggFuncInfo
[
++
aggno
];
Datum
args
[
2
];
...
...
@@ -309,6 +312,7 @@ ExecAgg(Agg *node)
{
if
(
noInitValue
[
aggno
])
{
int
attlen
=
0
;
int
byVal
=
0
;
/*
...
...
@@ -352,16 +356,16 @@ ExecAgg(Agg *node)
default:
elog
(
ERROR
,
"ExecAgg: Bad Agg->Target for Agg %d"
,
aggno
);
}
if
(
attlen
==
-
1
)
{
/* variable length */
attlen
=
VARSIZE
((
struct
varlena
*
)
newVal
);
}
value1
[
aggno
]
=
(
Datum
)
palloc
(
attlen
);
if
(
byVal
)
value1
[
aggno
]
=
newVal
;
else
memmove
((
char
*
)
(
value1
[
aggno
]),
(
char
*
)
newVal
,
attlen
);
{
if
(
attlen
==
-
1
)
/* variable length */
attlen
=
VARSIZE
((
struct
varlena
*
)
newVal
);
value1
[
aggno
]
=
(
Datum
)
palloc
(
attlen
);
memcpy
((
char
*
)
(
value1
[
aggno
]),
(
char
*
)
newVal
,
attlen
);
}
noInitValue
[
aggno
]
=
0
;
nulls
[
aggno
]
=
0
;
}
...
...
@@ -380,10 +384,9 @@ ExecAgg(Agg *node)
if
(
aggfns
->
xfn2
.
fn_addr
!=
NULL
)
{
Datum
xfn2_val
=
value2
[
aggno
];
args
[
0
]
=
value2
[
aggno
];
value2
[
aggno
]
=
(
Datum
)
fmgr_c
(
&
aggfns
->
xfn2
,
(
FmgrValues
*
)
&
xfn2_val
,
&
isNull2
);
(
FmgrValues
*
)
args
,
&
isNull2
);
Assert
(
!
isNull2
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录