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
36693c05
Commit
36693c05
authored
Jan 26, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More agg cleanup.
parent
38a5bda2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
24 deletions
+22
-24
src/backend/executor/nodeAgg.c
src/backend/executor/nodeAgg.c
+18
-20
src/backend/parser/gram.c
src/backend/parser/gram.c
+4
-4
No files found.
src/backend/executor/nodeAgg.c
View file @
36693c05
...
...
@@ -117,8 +117,7 @@ ExecAgg(Agg *node)
*/
/*
* We loop retrieving groups until we find one matching
* node->plan.qual
* We loop retrieving groups until we find one matching node->plan.qual
*/
do
{
...
...
@@ -141,14 +140,14 @@ ExecAgg(Agg *node)
MemSet
(
aggFuncInfo
,
0
,
sizeof
(
AggFuncInfo
)
*
nagg
);
noInitValue
=
(
int
*
)
palloc
(
sizeof
(
int
)
*
nagg
);
MemSet
(
noInitValue
,
0
,
sizeof
(
noInitValue
)
*
nagg
);
MemSet
(
noInitValue
,
0
,
sizeof
(
int
)
*
nagg
);
outerPlan
=
outerPlan
(
node
);
oneTuple
=
NULL
;
projInfo
=
aggstate
->
csstate
.
cstate
.
cs_ProjInfo
;
aggno
=
0
;
aggno
=
-
1
;
foreach
(
alist
,
node
->
aggs
)
{
Aggref
*
aggref
=
lfirst
(
alist
);
...
...
@@ -159,6 +158,8 @@ ExecAgg(Agg *node)
xfn2_oid
,
finalfn_oid
;
aggno
++
;
/* ---------------------
* find transfer functions of all the aggregates and initialize
* their initial values
...
...
@@ -226,7 +227,6 @@ ExecAgg(Agg *node)
nulls
[
aggno
]
=
1
;
}
}
aggno
++
;
}
/* ----------------
...
...
@@ -257,7 +257,7 @@ ExecAgg(Agg *node)
tupValue
=
projInfo
->
pi_tupValue
;
/* initially, set all the values to NULL */
null_array
=
palloc
(
tupType
->
natts
);
null_array
=
palloc
(
sizeof
(
char
)
*
tupType
->
natts
);
for
(
aggno
=
0
;
aggno
<
tupType
->
natts
;
aggno
++
)
null_array
[
aggno
]
=
'n'
;
oneTuple
=
heap_formtuple
(
tupType
,
tupValue
,
null_array
);
...
...
@@ -266,14 +266,14 @@ ExecAgg(Agg *node)
break
;
}
aggno
=
0
;
aggno
=
-
1
;
foreach
(
alist
,
node
->
aggs
)
{
Aggref
*
aggref
=
lfirst
(
alist
);
AttrNumber
attnum
;
int2
attlen
=
0
;
Datum
newVal
=
(
Datum
)
NULL
;
AggFuncInfo
*
aggfns
=
&
aggFuncInfo
[
aggno
];
AggFuncInfo
*
aggfns
=
&
aggFuncInfo
[
++
aggno
];
Datum
args
[
2
];
Node
*
tagnode
=
NULL
;
...
...
@@ -388,7 +388,6 @@ ExecAgg(Agg *node)
(
FmgrValues
*
)
&
xfn2_val
,
&
isNull2
);
Assert
(
!
isNull2
);
}
aggno
++
;
}
/*
...
...
@@ -407,11 +406,11 @@ ExecAgg(Agg *node)
* --------------
*/
aggno
=
0
;
aggno
=
-
1
;
foreach
(
alist
,
node
->
aggs
)
{
char
*
args
[
2
];
AggFuncInfo
*
aggfns
=
&
aggFuncInfo
[
aggno
];
AggFuncInfo
*
aggfns
=
&
aggFuncInfo
[
++
aggno
];
if
(
noInitValue
[
aggno
])
{
...
...
@@ -450,7 +449,6 @@ ExecAgg(Agg *node)
value1
[
aggno
]
=
value2
[
aggno
];
else
elog
(
ERROR
,
"ExecAgg: no valid transition functions??"
);
aggno
++
;
}
/*
...
...
@@ -539,10 +537,10 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
econtext
=
aggstate
->
csstate
.
cstate
.
cs_ExprContext
;
econtext
->
ecxt_values
=
(
Datum
*
)
palloc
(
sizeof
(
Datum
)
*
length
(
node
->
aggs
));
(
Datum
*
)
palloc
(
sizeof
(
Datum
)
*
length
(
node
->
aggs
));
MemSet
(
econtext
->
ecxt_values
,
0
,
sizeof
(
Datum
)
*
length
(
node
->
aggs
));
econtext
->
ecxt_nulls
=
(
char
*
)
palloc
(
length
(
node
->
aggs
));
MemSet
(
econtext
->
ecxt_nulls
,
0
,
length
(
node
->
aggs
));
econtext
->
ecxt_nulls
=
(
char
*
)
palloc
(
sizeof
(
char
)
*
length
(
node
->
aggs
));
MemSet
(
econtext
->
ecxt_nulls
,
0
,
sizeof
(
char
)
*
length
(
node
->
aggs
));
/*
* initializes child nodes
...
...
@@ -583,8 +581,8 @@ int
ExecCountSlotsAgg
(
Agg
*
node
)
{
return
ExecCountSlotsNode
(
outerPlan
(
node
))
+
ExecCountSlotsNode
(
innerPlan
(
node
))
+
AGG_NSLOTS
;
ExecCountSlotsNode
(
innerPlan
(
node
))
+
AGG_NSLOTS
;
}
/* ------------------------
...
...
@@ -654,8 +652,8 @@ aggGetAttr(TupleTableSlot *slot,
tempSlot
=
makeNode
(
TupleTableSlot
);
tempSlot
->
ttc_shouldFree
=
false
;
tempSlot
->
ttc_descIsNew
=
true
;
tempSlot
->
ttc_tupleDescriptor
=
(
TupleDesc
)
NULL
,
tempSlot
->
ttc_buffer
=
InvalidBuffer
;
tempSlot
->
ttc_tupleDescriptor
=
(
TupleDesc
)
NULL
;
tempSlot
->
ttc_buffer
=
InvalidBuffer
;
tempSlot
->
ttc_whichplan
=
-
1
;
tup
=
heap_copytuple
(
heapTuple
);
...
...
@@ -691,7 +689,7 @@ ExecReScanAgg(Agg *node, ExprContext *exprCtxt, Plan *parent)
aggstate
->
agg_done
=
FALSE
;
MemSet
(
econtext
->
ecxt_values
,
0
,
sizeof
(
Datum
)
*
length
(
node
->
aggs
));
MemSet
(
econtext
->
ecxt_nulls
,
0
,
length
(
node
->
aggs
));
MemSet
(
econtext
->
ecxt_nulls
,
0
,
sizeof
(
char
)
*
length
(
node
->
aggs
));
/*
* if chgParam of subnode is not null then plan will be re-scanned by
...
...
src/backend/parser/gram.c
View file @
36693c05
...
...
@@ -239,7 +239,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.6
3 1999/01/25 12:01:07 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.6
4 1999/01/26 23:32:04 momjian
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -4791,7 +4791,7 @@ static const short yycheck[] = { 3,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
214
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/
share/misc
/bison.simple"
#line 3 "/usr/
local/bison
/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
...
...
@@ -4984,7 +4984,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
#line 196 "/usr/
share/misc
/bison.simple"
#line 196 "/usr/
local/bison
/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
...
...
@@ -11088,7 +11088,7 @@ case 960:
break
;}
}
/* the action file gets copied in in place of this dollarsign */
#line 498 "/usr/
share/misc
/bison.simple"
#line 498 "/usr/
local/bison
/bison.simple"
yyvsp
-=
yylen
;
yyssp
-=
yylen
;
...
...
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