Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
5ce158c5
Commit
5ce158c5
authored
Oct 08, 1999
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove a no-longer-needed kluge for degenerate aggregate cases,
and update some comments.
parent
c528c42e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
23 deletions
+12
-23
src/backend/executor/execQual.c
src/backend/executor/execQual.c
+4
-1
src/backend/executor/nodeAgg.c
src/backend/executor/nodeAgg.c
+8
-22
No files found.
src/backend/executor/execQual.c
View file @
5ce158c5
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.6
2 1999/09/26 21:21:09
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.6
3 1999/10/08 03:49:55
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -209,6 +209,9 @@ ExecEvalArrayRef(ArrayRef *arrayRef,
static
Datum
ExecEvalAggref
(
Aggref
*
aggref
,
ExprContext
*
econtext
,
bool
*
isNull
)
{
if
(
econtext
->
ecxt_aggvalues
==
NULL
)
/* safety check */
elog
(
ERROR
,
"ExecEvalAggref: no aggregates in this expression context"
);
*
isNull
=
econtext
->
ecxt_aggnulls
[
aggref
->
aggno
];
return
econtext
->
ecxt_aggvalues
[
aggref
->
aggno
];
}
...
...
src/backend/executor/nodeAgg.c
View file @
5ce158c5
...
...
@@ -11,7 +11,7 @@
* SQL aggregates. (Do not expect POSTQUEL semantics.) -- ay 2/95
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.5
6 1999/09/28 02:03:19
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.5
7 1999/10/08 03:49:55
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -136,12 +136,11 @@ copyDatum(Datum val, int typLen, bool typByVal)
* sfunc1 is never applied when the current tuple's aggregated_value
* is NULL. sfunc2 is applied for each tuple if the aggref is marked
* 'usenulls', otherwise it is only applied when aggregated_value is
* not NULL. (usenulls is normally set only for the case of COUNT(*),
* since according to the SQL92 standard that is the only aggregate
* that considers nulls in its input. SQL92 requires COUNT(*) and
* COUNT(field) to behave differently --- the latter doesn't count nulls
* --- so we can't make this flag a column of pg_aggregate but must
* set it according to usage. Ugh.)
* not NULL. (usenulls was formerly used for COUNT(*), but is no longer
* needed for that purpose; as of 10/1999 the support for usenulls is
* dead code. I have not removed it because it seems like a potentially
* useful feature for user-defined aggregates. We'd just need to add a
* flag column to pg_aggregate and a parameter to CREATE AGGREGATE...)
*
* If the outer subplan is a Group node, ExecAgg returns as many tuples
* as there are groups.
...
...
@@ -534,27 +533,14 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
outerPlan
=
outerPlan
(
node
);
ExecInitNode
(
outerPlan
,
estate
,
(
Plan
*
)
node
);
/*
* Result runs in its own context, but make it use our aggregates fix
* for 'select sum(2+2)'
*/
if
(
IsA
(
outerPlan
,
Result
))
{
((
Result
*
)
outerPlan
)
->
resstate
->
cstate
.
cs_ProjInfo
->
pi_exprContext
->
ecxt_aggvalues
=
econtext
->
ecxt_aggvalues
;
((
Result
*
)
outerPlan
)
->
resstate
->
cstate
.
cs_ProjInfo
->
pi_exprContext
->
ecxt_aggnulls
=
econtext
->
ecxt_aggnulls
;
}
/* ----------------
* initialize tuple type.
* initialize
source
tuple type.
* ----------------
*/
ExecAssignScanTypeFromOuterPlan
((
Plan
*
)
node
,
&
aggstate
->
csstate
);
/*
* Initialize tuple type for both result and scan. This node does no
* projection
* Initialize result tuple type and projection info.
*/
ExecAssignResultTypeFromTL
((
Plan
*
)
node
,
&
aggstate
->
csstate
.
cstate
);
ExecAssignProjectionInfo
((
Plan
*
)
node
,
&
aggstate
->
csstate
.
cstate
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment