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
f22d8e66
Commit
f22d8e66
authored
Jan 14, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Function cleanupo for List* when it should be Node *.
parent
cb3ce64f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
25 deletions
+26
-25
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/plan/setrefs.c
+26
-25
No files found.
src/backend/optimizer/plan/setrefs.c
View file @
f22d8e66
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.1
3 1998/01/14 15:48:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.1
4 1998/01/14 19:55:53
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -42,7 +42,7 @@ static List *replace_subclause_joinvar_refs(List *clauses,
List
*
outer_tlist
,
List
*
inner_tlist
);
static
Var
*
replace_joinvar_refs
(
Var
*
var
,
List
*
outer_tlist
,
List
*
inner_tlist
);
static
List
*
tlist_temp_references
(
Oid
tempid
,
List
*
tlist
);
static
void
replace_result_clause
(
List
*
clause
,
List
*
subplanTargetList
);
static
void
replace_result_clause
(
Node
*
clause
,
List
*
subplanTargetList
);
static
bool
OperandIsInner
(
Node
*
opnd
,
int
inner_relid
);
static
void
replace_agg_clause
(
Node
*
expr
,
List
*
targetlist
);
static
Node
*
del_agg_clause
(
Node
*
clause
);
...
...
@@ -554,7 +554,7 @@ set_result_tlist_references(Result *resultNode)
{
entry
=
(
TargetEntry
*
)
lfirst
(
t
);
expr
=
(
Expr
*
)
get_expr
(
entry
);
replace_result_clause
((
List
*
)
expr
,
subplanTargetList
);
replace_result_clause
((
Node
*
)
expr
,
subplanTargetList
);
}
}
...
...
@@ -568,16 +568,15 @@ set_result_tlist_references(Result *resultNode)
*
*/
static
void
replace_result_clause
(
List
*
clause
,
replace_result_clause
(
Node
*
clause
,
List
*
subplanTargetList
)
/* target list of the
* subplan */
{
List
*
t
;
List
*
subClause
;
TargetEntry
*
subplanVar
;
if
(
IsA
(
clause
,
Var
))
{
TargetEntry
*
subplanVar
;
/*
* Ha! A Var node!
...
...
@@ -591,15 +590,20 @@ replace_result_clause(List *clause,
((
Var
*
)
clause
)
->
varno
=
(
Index
)
OUTER
;
((
Var
*
)
clause
)
->
varattno
=
subplanVar
->
resdom
->
resno
;
}
else
if
(
is_funcclause
((
Node
*
)
clause
))
else
if
(
IsA
(
clause
,
Aggreg
))
{
replace_result_clause
(((
Aggreg
*
)
clause
)
->
target
,
subplanTargetList
);
}
else
if
(
is_funcclause
(
clause
))
{
List
*
subExpr
;
/*
* This is a function. Recursively call this routine for its
* arguments...
*/
sub
Clause
=
((
Expr
*
)
clause
)
->
args
;
foreach
(
t
,
sub
Clause
)
sub
Expr
=
((
Expr
*
)
clause
)
->
args
;
foreach
(
t
,
sub
Expr
)
{
replace_result_clause
(
lfirst
(
t
),
subplanTargetList
);
}
...
...
@@ -607,39 +611,38 @@ replace_result_clause(List *clause,
else
if
(
IsA
(
clause
,
ArrayRef
))
{
ArrayRef
*
aref
=
(
ArrayRef
*
)
clause
;
/*
* This is an arrayref. Recursively call this routine for its
* expression and its index expression...
*/
subClause
=
aref
->
refupperindexpr
;
foreach
(
t
,
subClause
)
foreach
(
t
,
aref
->
refupperindexpr
)
{
replace_result_clause
(
lfirst
(
t
),
subplanTargetList
);
}
subClause
=
aref
->
reflowerindexpr
;
foreach
(
t
,
subClause
)
foreach
(
t
,
aref
->
reflowerindexpr
)
{
replace_result_clause
(
lfirst
(
t
),
subplanTargetList
);
}
replace_result_clause
(
(
List
*
)
aref
->
refexpr
,
replace_result_clause
(
aref
->
refexpr
,
subplanTargetList
);
replace_result_clause
(
(
List
*
)
aref
->
refassgnexpr
,
replace_result_clause
(
aref
->
refassgnexpr
,
subplanTargetList
);
}
else
if
(
is_opclause
(
(
Node
*
)
clause
))
else
if
(
is_opclause
(
clause
))
{
Node
*
subNode
;
/*
* This is an operator. Recursively call this routine for both its
* left and right operands
*/
sub
Clause
=
(
List
*
)
get_leftop
((
Expr
*
)
clause
);
replace_result_clause
(
sub
Claus
e
,
subplanTargetList
);
sub
Clause
=
(
List
*
)
get_rightop
((
Expr
*
)
clause
);
replace_result_clause
(
sub
Claus
e
,
subplanTargetList
);
sub
Node
=
(
Node
*
)
get_leftop
((
Expr
*
)
clause
);
replace_result_clause
(
sub
Nod
e
,
subplanTargetList
);
sub
Node
=
(
Node
*
)
get_rightop
((
Expr
*
)
clause
);
replace_result_clause
(
sub
Nod
e
,
subplanTargetList
);
}
else
if
(
IsA
(
clause
,
Param
)
||
IsA
(
clause
,
Const
))
else
if
(
IsA
(
clause
,
Param
)
||
IsA
(
clause
,
Const
))
{
/* do nothing! */
}
...
...
@@ -731,10 +734,9 @@ static void
replace_agg_clause
(
Node
*
clause
,
List
*
subplanTargetList
)
{
List
*
t
;
TargetEntry
*
subplanVar
;
if
(
IsA
(
clause
,
Var
))
{
TargetEntry
*
subplanVar
;
/*
* Ha! A Var node!
...
...
@@ -784,7 +786,6 @@ replace_agg_clause(Node *clause, List *subplanTargetList)
}
else
if
(
is_opclause
(
clause
))
{
/*
* This is an operator. Recursively call this routine for both its
* left and right operands
...
...
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