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
17467bb7
Commit
17467bb7
authored
Jan 24, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Aggreg to Aggref.
parent
157349e3
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
221 additions
and
221 deletions
+221
-221
src/backend/executor/execQual.c
src/backend/executor/execQual.c
+6
-6
src/backend/executor/nodeAgg.c
src/backend/executor/nodeAgg.c
+5
-5
src/backend/nodes/copyfuncs.c
src/backend/nodes/copyfuncs.c
+7
-7
src/backend/nodes/outfuncs.c
src/backend/nodes/outfuncs.c
+5
-5
src/backend/nodes/readfuncs.c
src/backend/nodes/readfuncs.c
+8
-8
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/plan/setrefs.c
+12
-12
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/plan/subselect.c
+7
-7
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/clauses.c
+3
-3
src/backend/optimizer/util/tlist.c
src/backend/optimizer/util/tlist.c
+2
-2
src/backend/optimizer/util/var.c
src/backend/optimizer/util/var.c
+3
-3
src/backend/parser/gram.c
src/backend/parser/gram.c
+1
-1
src/backend/parser/parse_agg.c
src/backend/parser/parse_agg.c
+14
-14
src/backend/parser/parse_expr.c
src/backend/parser/parse_expr.c
+3
-3
src/backend/parser/parse_target.c
src/backend/parser/parse_target.c
+3
-3
src/backend/rewrite/locks.c
src/backend/rewrite/locks.c
+3
-3
src/backend/rewrite/rewriteHandler.c
src/backend/rewrite/rewriteHandler.c
+114
-114
src/backend/rewrite/rewriteManip.c
src/backend/rewrite/rewriteManip.c
+11
-11
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/ruleutils.c
+5
-5
src/include/nodes/nodes.h
src/include/nodes/nodes.h
+2
-2
src/include/nodes/primnodes.h
src/include/nodes/primnodes.h
+4
-4
src/include/parser/parse_agg.h
src/include/parser/parse_agg.h
+3
-3
No files found.
src/backend/executor/execQual.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.
39 1998/12/04 15:33:19 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.
40 1999/01/24 00:28:18 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -67,7 +67,7 @@ bool execConstByVal;
int
execConstLen
;
/* static functions decls */
static
Datum
ExecEvalAggre
g
(
Aggreg
*
agg
,
ExprContext
*
econtext
,
bool
*
isNull
);
static
Datum
ExecEvalAggre
f
(
Aggref
*
agg
,
ExprContext
*
econtext
,
bool
*
isNull
);
static
Datum
ExecEvalArrayRef
(
ArrayRef
*
arrayRef
,
ExprContext
*
econtext
,
bool
*
isNull
,
bool
*
isDone
);
static
Datum
ExecEvalAnd
(
Expr
*
andExpr
,
ExprContext
*
econtext
,
bool
*
isNull
);
...
...
@@ -185,14 +185,14 @@ ExecEvalArrayRef(ArrayRef *arrayRef,
/* ----------------------------------------------------------------
* ExecEvalAggre
g
* ExecEvalAggre
f
*
* Returns a Datum whose value is the value of the precomputed
* aggregate found in the given expression context.
* ----------------------------------------------------------------
*/
static
Datum
ExecEvalAggre
g
(
Aggreg
*
agg
,
ExprContext
*
econtext
,
bool
*
isNull
)
ExecEvalAggre
f
(
Aggref
*
agg
,
ExprContext
*
econtext
,
bool
*
isNull
)
{
*
isNull
=
econtext
->
ecxt_nulls
[
agg
->
aggno
];
return
econtext
->
ecxt_values
[
agg
->
aggno
];
...
...
@@ -1268,8 +1268,8 @@ ExecEvalExpr(Node *expression,
isNull
,
isDone
);
break
;
case
T_Aggre
g
:
retDatum
=
(
Datum
)
ExecEvalAggre
g
((
Aggreg
*
)
expression
,
case
T_Aggre
f
:
retDatum
=
(
Datum
)
ExecEvalAggre
f
((
Aggref
*
)
expression
,
econtext
,
isNull
);
break
;
...
...
src/backend/executor/nodeAgg.c
View file @
17467bb7
...
...
@@ -45,7 +45,7 @@ typedef struct AggFuncInfo
FmgrInfo
finalfn
;
}
AggFuncInfo
;
static
Datum
aggGetAttr
(
TupleTableSlot
*
tuple
,
Aggre
g
*
agg
,
bool
*
isNull
);
static
Datum
aggGetAttr
(
TupleTableSlot
*
tuple
,
Aggre
f
*
agg
,
bool
*
isNull
);
/* ---------------------------------------
...
...
@@ -90,7 +90,7 @@ ExecAgg(Agg *node)
{
AggState
*
aggstate
;
EState
*
estate
;
Aggre
g
**
aggregates
;
Aggre
f
**
aggregates
;
Plan
*
outerPlan
;
int
i
,
nagg
;
...
...
@@ -133,7 +133,7 @@ ExecAgg(Agg *node)
nagg
=
length
(
node
->
aggs
);
aggregates
=
(
Aggre
g
**
)
palloc
(
sizeof
(
Aggreg
*
)
*
nagg
);
aggregates
=
(
Aggre
f
**
)
palloc
(
sizeof
(
Aggref
*
)
*
nagg
);
/* take List* and make it an array that can be quickly indexed */
alist
=
node
->
aggs
;
...
...
@@ -163,7 +163,7 @@ ExecAgg(Agg *node)
for
(
i
=
0
;
i
<
nagg
;
i
++
)
{
Aggre
g
*
agg
;
Aggre
f
*
agg
;
char
*
aggname
;
HeapTuple
aggTuple
;
Form_pg_aggregate
aggp
;
...
...
@@ -628,7 +628,7 @@ ExecEndAgg(Agg *node)
*/
static
Datum
aggGetAttr
(
TupleTableSlot
*
slot
,
Aggre
g
*
agg
,
Aggre
f
*
agg
,
bool
*
isNull
)
{
Datum
result
;
...
...
src/backend/nodes/copyfuncs.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.5
3 1999/01/21 22:55:41
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.5
4 1999/01/24 00:28:19
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -899,13 +899,13 @@ _copyFunc(Func *from)
}
/* ----------------
* _copyAggre
g
* _copyAggre
f
* ----------------
*/
static
Aggre
g
*
_copyAggre
g
(
Aggreg
*
from
)
static
Aggre
f
*
_copyAggre
f
(
Aggref
*
from
)
{
Aggre
g
*
newnode
=
makeNode
(
Aggreg
);
Aggre
f
*
newnode
=
makeNode
(
Aggref
);
/* ----------------
* copy remainder of node
...
...
@@ -1782,8 +1782,8 @@ copyObject(void *from)
case
T_ArrayRef
:
retval
=
_copyArrayRef
(
from
);
break
;
case
T_Aggre
g
:
retval
=
_copyAggre
g
(
from
);
case
T_Aggre
f
:
retval
=
_copyAggre
f
(
from
);
break
;
case
T_SubLink
:
retval
=
_copySubLink
(
from
);
...
...
src/backend/nodes/outfuncs.c
View file @
17467bb7
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: outfuncs.c,v 1.6
0 1999/01/21 16:08:36 vadim
Exp $
* $Id: outfuncs.c,v 1.6
1 1999/01/24 00:28:20 momjian
Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
...
...
@@ -686,10 +686,10 @@ _outConst(StringInfo str, Const *node)
}
/*
* Aggre
g
* Aggre
f
*/
static
void
_outAggre
g
(
StringInfo
str
,
Aggreg
*
node
)
_outAggre
f
(
StringInfo
str
,
Aggref
*
node
)
{
appendStringInfo
(
str
,
" AGGREG :aggname %s :basetype %u :aggtype %u :target "
,
...
...
@@ -1506,8 +1506,8 @@ _outNode(StringInfo str, void *obj)
case
T_Const
:
_outConst
(
str
,
obj
);
break
;
case
T_Aggre
g
:
_outAggre
g
(
str
,
obj
);
case
T_Aggre
f
:
_outAggre
f
(
str
,
obj
);
break
;
case
T_SubLink
:
_outSubLink
(
str
,
obj
);
...
...
src/backend/nodes/readfuncs.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.4
2 1999/01/21 16:08:37 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.4
3 1999/01/24 00:28:20 momjian
Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
...
...
@@ -1161,19 +1161,19 @@ _readParam()
}
/* ----------------
* _readAggre
g
* _readAggre
f
*
* Aggre
g
is a subclass of Node
* Aggre
f
is a subclass of Node
* ----------------
*/
static
Aggre
g
*
_readAggre
g
()
static
Aggre
f
*
_readAggre
f
()
{
Aggre
g
*
local_node
;
Aggre
f
*
local_node
;
char
*
token
;
int
length
;
local_node
=
makeNode
(
Aggre
g
);
local_node
=
makeNode
(
Aggre
f
);
token
=
lsptok
(
NULL
,
&
length
);
/* eat :aggname */
token
=
lsptok
(
NULL
,
&
length
);
/* get aggname */
...
...
@@ -2040,7 +2040,7 @@ parsePlanString(void)
else
if
(
!
strncmp
(
token
,
"SORT"
,
length
))
return_value
=
_readSort
();
else
if
(
!
strncmp
(
token
,
"AGGREG"
,
length
))
return_value
=
_readAggre
g
();
return_value
=
_readAggre
f
();
else
if
(
!
strncmp
(
token
,
"SUBLINK"
,
length
))
return_value
=
_readSubLink
();
else
if
(
!
strncmp
(
token
,
"AGG"
,
length
))
...
...
src/backend/optimizer/plan/setrefs.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.3
1 1999/01/23 23:28:08
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.3
2 1999/01/24 00:28:20
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -611,8 +611,8 @@ replace_result_clause(Node *clause,
((
Var
*
)
clause
)
->
varno
=
(
Index
)
OUTER
;
((
Var
*
)
clause
)
->
varattno
=
subplanVar
->
resdom
->
resno
;
}
else
if
(
IsA
(
clause
,
Aggre
g
))
replace_result_clause
(((
Aggre
g
*
)
clause
)
->
target
,
subplanTargetList
);
else
if
(
IsA
(
clause
,
Aggre
f
))
replace_result_clause
(((
Aggre
f
*
)
clause
)
->
target
,
subplanTargetList
);
else
if
(
is_funcclause
(
clause
))
{
List
*
subExpr
;
...
...
@@ -704,7 +704,7 @@ OperandIsInner(Node *opnd, int inner_relid)
* changes the target list of an Agg node so that it points to
* the tuples returned by its left tree subplan.
*
* We now also generate a linked list of Aggre
g
pointers for Agg.
* We now also generate a linked list of Aggre
f
pointers for Agg.
*
*/
List
*
...
...
@@ -765,10 +765,10 @@ replace_agg_clause(Node *clause, List *subplanTargetList)
}
return
agg_list
;
}
else
if
(
IsA
(
clause
,
Aggre
g
))
else
if
(
IsA
(
clause
,
Aggre
f
))
{
return
lcons
(
clause
,
replace_agg_clause
(((
Aggre
g
*
)
clause
)
->
target
,
subplanTargetList
));
replace_agg_clause
(((
Aggre
f
*
)
clause
)
->
target
,
subplanTargetList
));
}
else
if
(
IsA
(
clause
,
ArrayRef
))
{
...
...
@@ -866,11 +866,11 @@ del_agg_clause(Node *clause)
foreach
(
t
,
((
Expr
*
)
clause
)
->
args
)
lfirst
(
t
)
=
del_agg_clause
(
lfirst
(
t
));
}
else
if
(
IsA
(
clause
,
Aggre
g
))
else
if
(
IsA
(
clause
,
Aggre
f
))
{
/* here is the real action, to remove the Agg node */
return
del_agg_clause
(((
Aggre
g
*
)
clause
)
->
target
);
return
del_agg_clause
(((
Aggre
f
*
)
clause
)
->
target
);
}
else
if
(
IsA
(
clause
,
ArrayRef
))
...
...
@@ -967,10 +967,10 @@ check_having_qual_for_vars(Node *clause, List *targetlist_so_far)
}
return
targetlist_so_far
;
}
else
if
(
IsA
(
clause
,
Aggre
g
))
else
if
(
IsA
(
clause
,
Aggre
f
))
{
targetlist_so_far
=
check_having_qual_for_vars
(((
Aggre
g
*
)
clause
)
->
target
,
targetlist_so_far
);
check_having_qual_for_vars
(((
Aggre
f
*
)
clause
)
->
target
,
targetlist_so_far
);
return
targetlist_so_far
;
}
else
if
(
IsA
(
clause
,
ArrayRef
))
...
...
@@ -1100,10 +1100,10 @@ check_having_qual_for_aggs(Node *clause, List *subplanTargetList, List *groupCla
}
return
agg_list
;
}
else
if
(
IsA
(
clause
,
Aggre
g
))
else
if
(
IsA
(
clause
,
Aggre
f
))
{
return
lcons
(
clause
,
check_having_qual_for_aggs
(((
Aggre
g
*
)
clause
)
->
target
,
subplanTargetList
,
check_having_qual_for_aggs
(((
Aggre
f
*
)
clause
)
->
target
,
subplanTargetList
,
groupClause
));
}
else
if
(
IsA
(
clause
,
ArrayRef
))
...
...
src/backend/optimizer/plan/subselect.c
View file @
17467bb7
...
...
@@ -282,8 +282,8 @@ _finalize_primnode(void *expr, List **subplan)
else
if
(
or_clause
(
expr
)
||
and_clause
(
expr
)
||
is_opclause
(
expr
)
||
not_clause
(
expr
)
||
is_funcclause
(
expr
))
return
_finalize_primnode
(((
Expr
*
)
expr
)
->
args
,
subplan
);
else
if
(
IsA
(
expr
,
Aggre
g
))
return
_finalize_primnode
(((
Aggre
g
*
)
expr
)
->
target
,
subplan
);
else
if
(
IsA
(
expr
,
Aggre
f
))
return
_finalize_primnode
(((
Aggre
f
*
)
expr
)
->
target
,
subplan
);
else
if
(
IsA
(
expr
,
ArrayRef
))
{
result
=
_finalize_primnode
(((
ArrayRef
*
)
expr
)
->
refupperindexpr
,
subplan
);
...
...
@@ -349,9 +349,9 @@ SS_replace_correlation_vars(Node *expr)
not_clause
(
expr
)
||
is_funcclause
(
expr
))
((
Expr
*
)
expr
)
->
args
=
(
List
*
)
SS_replace_correlation_vars
((
Node
*
)
((
Expr
*
)
expr
)
->
args
);
else
if
(
IsA
(
expr
,
Aggre
g
))
((
Aggre
g
*
)
expr
)
->
target
=
SS_replace_correlation_vars
((
Node
*
)
((
Aggre
g
*
)
expr
)
->
target
);
else
if
(
IsA
(
expr
,
Aggre
f
))
((
Aggre
f
*
)
expr
)
->
target
=
SS_replace_correlation_vars
((
Node
*
)
((
Aggre
f
*
)
expr
)
->
target
);
else
if
(
IsA
(
expr
,
ArrayRef
))
{
((
ArrayRef
*
)
expr
)
->
refupperindexpr
=
(
List
*
)
...
...
@@ -530,8 +530,8 @@ SS_pull_subplan(void *expr)
else
if
(
or_clause
(
expr
)
||
and_clause
(
expr
)
||
is_opclause
(
expr
)
||
not_clause
(
expr
)
||
is_funcclause
(
expr
))
return
SS_pull_subplan
(((
Expr
*
)
expr
)
->
args
);
else
if
(
IsA
(
expr
,
Aggre
g
))
return
SS_pull_subplan
(((
Aggre
g
*
)
expr
)
->
target
);
else
if
(
IsA
(
expr
,
Aggre
f
))
return
SS_pull_subplan
(((
Aggre
f
*
)
expr
)
->
target
);
else
if
(
IsA
(
expr
,
ArrayRef
))
{
result
=
SS_pull_subplan
(((
ArrayRef
*
)
expr
)
->
refupperindexpr
);
...
...
src/backend/optimizer/util/clauses.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.2
6 1998/12/04 15:34:14 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.2
7 1999/01/24 00:28:21 momjian
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -145,7 +145,7 @@ static bool
agg_clause
(
Node
*
clause
)
{
return
(
clause
!=
NULL
&&
nodeTag
(
clause
)
==
T_Aggre
g
);
(
clause
!=
NULL
&&
nodeTag
(
clause
)
==
T_Aggre
f
);
}
/*****************************************************************************
...
...
@@ -548,7 +548,7 @@ fix_opid(Node *clause)
fix_opid
((
Node
*
)
get_rightop
((
Expr
*
)
clause
));
}
else
if
(
agg_clause
(
clause
))
fix_opid
(((
Aggre
g
*
)
clause
)
->
target
);
fix_opid
(((
Aggre
f
*
)
clause
)
->
target
);
else
if
(
is_subplan
(
clause
)
&&
((
SubPlan
*
)
((
Expr
*
)
clause
)
->
oper
)
->
sublink
->
subLinkType
!=
EXISTS_SUBLINK
)
{
...
...
src/backend/optimizer/util/tlist.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.2
1 1998/12/04 15:34:15 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.2
2 1999/01/24 00:28:22 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -483,7 +483,7 @@ flatten_tlistentry(Node *tlistentry, List *flat_tlist)
return
((
Node
*
)
make_funcclause
((
Func
*
)
expr
->
oper
,
temp_result
));
}
else
if
(
IsA
(
tlistentry
,
Aggre
g
))
else
if
(
IsA
(
tlistentry
,
Aggre
f
))
{
return
tlistentry
;
}
...
...
src/backend/optimizer/util/var.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.1
4 1998/12/04 15:34:15 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.1
5 1999/01/24 00:28:22 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -194,8 +194,8 @@ pull_var_clause(Node *clause)
retval
=
nconc
(
retval
,
pull_var_clause
(
lfirst
(((
Expr
*
)
lfirst
(
temp
))
->
args
)));
}
else
if
(
IsA
(
clause
,
Aggre
g
))
retval
=
pull_var_clause
(((
Aggre
g
*
)
clause
)
->
target
);
else
if
(
IsA
(
clause
,
Aggre
f
))
retval
=
pull_var_clause
(((
Aggre
f
*
)
clause
)
->
target
);
else
if
(
IsA
(
clause
,
ArrayRef
))
{
List
*
temp
;
...
...
src/backend/parser/gram.c
View file @
17467bb7
...
...
@@ -239,7 +239,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.6
1 1999/01/22 19:35:49
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.6
2 1999/01/24 00:28:23
momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
src/backend/parser/parse_agg.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.1
5 1998/12/08 06:18:56 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.1
6 1999/01/24 00:28:29 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -37,7 +37,7 @@ static bool tleIsAggOrGroupCol(TargetEntry *tle, List *groupClause);
/*
* contain_agg_clause--
* Recursively find aggre
g
nodes from a clause.
* Recursively find aggre
f
nodes from a clause.
*
* Returns true if any aggregate found.
*/
...
...
@@ -46,7 +46,7 @@ contain_agg_clause(Node *clause)
{
if
(
clause
==
NULL
)
return
FALSE
;
else
if
(
IsA
(
clause
,
Aggre
g
))
else
if
(
IsA
(
clause
,
Aggre
f
))
return
TRUE
;
else
if
(
IsA
(
clause
,
Iter
))
return
contain_agg_clause
(((
Iter
*
)
clause
)
->
iterexpr
);
...
...
@@ -105,7 +105,7 @@ exprIsAggOrGroupCol(Node *expr, List *groupClause)
List
*
gl
;
if
(
expr
==
NULL
||
IsA
(
expr
,
Const
)
||
IsA
(
expr
,
Param
)
||
IsA
(
expr
,
Aggre
g
)
||
IsA
(
expr
,
Param
)
||
IsA
(
expr
,
Aggre
f
)
||
IsA
(
expr
,
SubLink
))
/* can't handle currently !!! */
return
TRUE
;
...
...
@@ -155,7 +155,7 @@ tleIsAggOrGroupCol(TargetEntry *tle, List *groupClause)
}
}
if
(
IsA
(
expr
,
Aggre
g
))
if
(
IsA
(
expr
,
Aggre
f
))
return
TRUE
;
if
(
IsA
(
expr
,
Expr
))
...
...
@@ -217,7 +217,7 @@ parseCheckAggregates(ParseState *pstate, Query *qry)
}
Aggre
g
*
Aggre
f
*
ParseAgg
(
ParseState
*
pstate
,
char
*
aggname
,
Oid
basetype
,
List
*
target
,
int
precedence
)
{
...
...
@@ -225,7 +225,7 @@ ParseAgg(ParseState *pstate, char *aggname, Oid basetype,
Oid
vartype
;
Oid
xfn1
;
Form_pg_aggregate
aggform
;
Aggre
g
*
aggreg
;
Aggre
f
*
aggref
;
HeapTuple
theAggTuple
;
bool
usenulls
=
false
;
...
...
@@ -324,18 +324,18 @@ ParseAgg(ParseState *pstate, char *aggname, Oid basetype,
}
}
aggre
g
=
makeNode
(
Aggreg
);
aggre
g
->
aggname
=
pstrdup
(
aggname
);
aggre
g
->
basetype
=
aggform
->
aggbasetype
;
aggre
g
->
aggtype
=
fintype
;
aggre
f
=
makeNode
(
Aggref
);
aggre
f
->
aggname
=
pstrdup
(
aggname
);
aggre
f
->
basetype
=
aggform
->
aggbasetype
;
aggre
f
->
aggtype
=
fintype
;
aggre
g
->
target
=
lfirst
(
target
);
aggre
f
->
target
=
lfirst
(
target
);
if
(
usenulls
)
aggre
g
->
usenulls
=
true
;
aggre
f
->
usenulls
=
true
;
pstate
->
p_hasAggs
=
true
;
return
aggre
g
;
return
aggre
f
;
}
/*
...
...
src/backend/parser/parse_expr.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.3
8 1998/12/13 23:56:43 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.3
9 1999/01/24 00:28:29 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -586,8 +586,8 @@ exprType(Node *expr)
case
T_ArrayRef
:
type
=
((
ArrayRef
*
)
expr
)
->
refelemtype
;
break
;
case
T_Aggre
g
:
type
=
((
Aggre
g
*
)
expr
)
->
aggtype
;
case
T_Aggre
f
:
type
=
((
Aggre
f
*
)
expr
)
->
aggtype
;
break
;
case
T_Param
:
type
=
((
Param
*
)
expr
)
->
paramtype
;
...
...
src/backend/parser/parse_target.c
View file @
17467bb7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.3
2 1998/12/13 23:56:44 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.3
3 1999/01/24 00:28:30 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -872,8 +872,8 @@ FigureColname(Node *expr, Node *resval)
{
switch
(
nodeTag
(
expr
))
{
case
T_Aggre
g
:
return
(
char
*
)
((
Aggre
g
*
)
expr
)
->
aggname
;
case
T_Aggre
f
:
return
(
char
*
)
((
Aggre
f
*
)
expr
)
->
aggname
;
case
T_Expr
:
if
(((
Expr
*
)
expr
)
->
opType
==
FUNC_EXPR
)
{
...
...
src/backend/rewrite/locks.c
View file @
17467bb7
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.1
4 1998/10/02 16:27:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.1
5 1999/01/24 00:28:30
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -66,9 +66,9 @@ nodeThisLockWasTriggered(Node *node, int varno, AttrNumber attnum,
sublevels_up
);
}
break
;
case
T_Aggre
g
:
case
T_Aggre
f
:
{
Aggre
g
*
agg
=
(
Aggreg
*
)
node
;
Aggre
f
*
agg
=
(
Aggref
*
)
node
;
return
nodeThisLockWasTriggered
(
agg
->
target
,
varno
,
attnum
,
sublevels_up
);
...
...
src/backend/rewrite/rewriteHandler.c
View file @
17467bb7
This diff is collapsed.
Click to expand it.
src/backend/rewrite/rewriteManip.c
View file @
17467bb7
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.2
4 1999/01/18 00:09:56
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.2
5 1999/01/24 00:28:31
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -53,9 +53,9 @@ OffsetVarNodes(Node *node, int offset, int sublevels_up)
}
break
;
case
T_Aggre
g
:
case
T_Aggre
f
:
{
Aggre
g
*
agg
=
(
Aggreg
*
)
node
;
Aggre
f
*
agg
=
(
Aggref
*
)
node
;
OffsetVarNodes
(
(
Node
*
)(
agg
->
target
),
...
...
@@ -271,9 +271,9 @@ ChangeVarNodes(Node *node, int rt_index, int new_index, int sublevels_up)
}
break
;
case
T_Aggre
g
:
case
T_Aggre
f
:
{
Aggre
g
*
agg
=
(
Aggreg
*
)
node
;
Aggre
f
*
agg
=
(
Aggref
*
)
node
;
ChangeVarNodes
(
(
Node
*
)(
agg
->
target
),
...
...
@@ -641,8 +641,8 @@ ResolveNew(RewriteInfo *info, List *targetlist, Node **nodePtr,
ResolveNew
(
info
,
targetlist
,
&
((
TargetEntry
*
)
node
)
->
expr
,
sublevels_up
);
break
;
case
T_Aggre
g
:
ResolveNew
(
info
,
targetlist
,
&
((
Aggre
g
*
)
node
)
->
target
,
case
T_Aggre
f
:
ResolveNew
(
info
,
targetlist
,
&
((
Aggre
f
*
)
node
)
->
target
,
sublevels_up
);
break
;
case
T_Expr
:
...
...
@@ -746,9 +746,9 @@ nodeHandleRIRAttributeRule(Node **nodePtr,
sublevels_up
);
}
break
;
case
T_Aggre
g
:
case
T_Aggre
f
:
{
Aggre
g
*
agg
=
(
Aggreg
*
)
node
;
Aggre
f
*
agg
=
(
Aggref
*
)
node
;
nodeHandleRIRAttributeRule
(
&
agg
->
target
,
rtable
,
targetlist
,
rt_index
,
attr_num
,
modified
,
badsql
,
...
...
@@ -911,9 +911,9 @@ nodeHandleViewRule(Node **nodePtr,
rt_index
,
modified
,
sublevels_up
);
}
break
;
case
T_Aggre
g
:
case
T_Aggre
f
:
{
Aggre
g
*
agg
=
(
Aggreg
*
)
node
;
Aggre
f
*
agg
=
(
Aggref
*
)
node
;
nodeHandleViewRule
(
&
(
agg
->
target
),
rtable
,
targetlist
,
rt_index
,
modified
,
sublevels_up
);
...
...
src/backend/utils/adt/ruleutils.c
View file @
17467bb7
...
...
@@ -3,7 +3,7 @@
* out of it's tuple
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.
6 1998/10/26 01:01:35 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.
7 1999/01/24 00:28:32 momjian
Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
@@ -1245,9 +1245,9 @@ get_rule_expr(QryHier *qh, int rt_index, Node *node, bool varprefix)
}
break
;
case
T_Aggre
g
:
case
T_Aggre
f
:
{
Aggre
g
*
agg
=
(
Aggreg
*
)
node
;
Aggre
f
*
agg
=
(
Aggref
*
)
node
;
strcat
(
buf
,
"
\"
"
);
strcat
(
buf
,
agg
->
aggname
);
...
...
@@ -1727,9 +1727,9 @@ check_if_rte_used(int rt_index, Node *node, int sup)
}
break
;
case
T_Aggre
g
:
case
T_Aggre
f
:
{
Aggre
g
*
agg
=
(
Aggreg
*
)
node
;
Aggre
f
*
agg
=
(
Aggref
*
)
node
;
return
check_if_rte_used
(
rt_index
,
(
Node
*
)
(
agg
->
target
),
sup
);
...
...
src/include/nodes/nodes.h
View file @
17467bb7
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: nodes.h,v 1.3
4 1999/01/21 16:08:53 vadim
Exp $
* $Id: nodes.h,v 1.3
5 1999/01/24 00:28:33 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -60,7 +60,7 @@ typedef enum NodeTag
T_Oper
,
T_Const
,
T_Param
,
T_Aggre
g
,
T_Aggre
f
,
T_SubLink
,
T_Func
,
T_Array
,
...
...
src/include/nodes/primnodes.h
View file @
17467bb7
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: primnodes.h,v 1.2
3 1998/09/01 04:36:47
momjian Exp $
* $Id: primnodes.h,v 1.2
4 1999/01/24 00:28:34
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -255,7 +255,7 @@ typedef struct Func
}
Func
;
/* ----------------
* Aggre
g
* Aggre
f
* aggname - name of the aggregate
* basetype - base type Oid of the aggregate
* aggtype - type Oid of final result of the aggregate
...
...
@@ -263,7 +263,7 @@ typedef struct Func
* aggno - index to ecxt_values
* ----------------
*/
typedef
struct
Aggre
g
typedef
struct
Aggre
f
{
NodeTag
type
;
char
*
aggname
;
...
...
@@ -272,7 +272,7 @@ typedef struct Aggreg
Node
*
target
;
int
aggno
;
bool
usenulls
;
}
Aggre
g
;
}
Aggre
f
;
/* ----------------
* SubLink
...
...
src/include/parser/parse_agg.h
View file @
17467bb7
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_agg.h,v 1.
7 1998/09/01 04:37:29
momjian Exp $
* $Id: parse_agg.h,v 1.
8 1999/01/24 00:28:37
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -18,9 +18,9 @@
#include <nodes/primnodes.h>
#include <parser/parse_node.h>
extern
void
AddAggToParseState
(
ParseState
*
pstate
,
Aggre
g
*
aggreg
);
extern
void
AddAggToParseState
(
ParseState
*
pstate
,
Aggre
f
*
aggref
);
extern
void
parseCheckAggregates
(
ParseState
*
pstate
,
Query
*
qry
);
extern
Aggre
g
*
ParseAgg
(
ParseState
*
pstate
,
char
*
aggname
,
Oid
basetype
,
extern
Aggre
f
*
ParseAgg
(
ParseState
*
pstate
,
char
*
aggname
,
Oid
basetype
,
List
*
target
,
int
precedence
);
extern
void
agg_error
(
char
*
caller
,
char
*
aggname
,
Oid
basetypeID
);
...
...
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