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
dc892fd3
Commit
dc892fd3
authored
Feb 13, 1998
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for subselects.
(Have to re-visit readfuncs.c)
parent
1a105cef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
5 deletions
+88
-5
src/backend/nodes/copyfuncs.c
src/backend/nodes/copyfuncs.c
+31
-1
src/backend/nodes/equalfuncs.c
src/backend/nodes/equalfuncs.c
+17
-1
src/backend/nodes/outfuncs.c
src/backend/nodes/outfuncs.c
+35
-2
src/backend/nodes/readfuncs.c
src/backend/nodes/readfuncs.c
+5
-1
No files found.
src/backend/nodes/copyfuncs.c
View file @
dc892fd3
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.3
7 1998/02/10 04:00:44 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.3
8 1998/02/13 03:27:42 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -79,6 +79,8 @@ listCopy(List *list)
static
void
CopyPlanFields
(
Plan
*
from
,
Plan
*
newnode
)
{
extern
List
*
SS_pull_subplan
(
void
*
expr
);
newnode
->
cost
=
from
->
cost
;
newnode
->
plan_size
=
from
->
plan_size
;
newnode
->
plan_width
=
from
->
plan_width
;
...
...
@@ -88,6 +90,15 @@ CopyPlanFields(Plan *from, Plan *newnode)
newnode
->
qual
=
copyObject
(
from
->
qual
);
newnode
->
lefttree
=
copyObject
(
from
->
lefttree
);
newnode
->
righttree
=
copyObject
(
from
->
righttree
);
newnode
->
extParam
=
listCopy
(
from
->
extParam
);
newnode
->
locParam
=
listCopy
(
from
->
locParam
);
newnode
->
chgParam
=
listCopy
(
from
->
chgParam
);
Node_Copy
(
from
,
newnode
,
initPlan
);
if
(
from
->
subPlan
!=
NULL
)
newnode
->
subPlan
=
SS_pull_subplan
(
newnode
->
qual
);
else
newnode
->
subPlan
=
NULL
;
newnode
->
nParamExec
=
from
->
nParamExec
;
}
/* ----------------
...
...
@@ -575,6 +586,22 @@ _copyHash(Hash *from)
return
newnode
;
}
static
SubPlan
*
_copySubPlan
(
SubPlan
*
from
)
{
SubPlan
*
newnode
=
makeNode
(
SubPlan
);
Node_Copy
(
from
,
newnode
,
plan
);
newnode
->
plan_id
=
from
->
plan_id
;
Node_Copy
(
from
,
newnode
,
rtable
);
newnode
->
setParam
=
listCopy
(
from
->
setParam
);
newnode
->
parParam
=
listCopy
(
from
->
parParam
);
Node_Copy
(
from
,
newnode
,
sublink
);
newnode
->
shutdown
=
from
->
shutdown
;
return
newnode
;
}
/* ****************************************************************
* primnodes.h copy functions
* ****************************************************************
...
...
@@ -1661,6 +1688,9 @@ copyObject(void *from)
case
T_Hash
:
retval
=
_copyHash
(
from
);
break
;
case
T_SubPlan
:
retval
=
_copySubPlan
(
from
);
break
;
/*
* PRIMITIVE NODES
...
...
src/backend/nodes/equalfuncs.c
View file @
dc892fd3
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.1
4 1998/02/10 04:00:47 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.1
5 1998/02/13 03:27:44 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -236,6 +236,7 @@ _equalParam(Param *a, Param *b)
return
(
false
);
break
;
case
PARAM_NUM
:
case
PARAM_EXEC
:
if
(
a
->
paramid
!=
b
->
paramid
)
return
(
false
);
break
;
...
...
@@ -503,6 +504,18 @@ _equalIndexScan(IndexScan *a, IndexScan *b)
return
(
true
);
}
static
bool
_equalSubPlan
(
SubPlan
*
a
,
SubPlan
*
b
)
{
if
(
a
->
plan_id
!=
b
->
plan_id
)
return
(
false
);
if
(
!
equal
((
a
->
sublink
->
oper
),
(
b
->
sublink
->
oper
)))
return
(
false
);
return
(
true
);
}
static
bool
_equalJInfo
(
JInfo
*
a
,
JInfo
*
b
)
{
...
...
@@ -680,6 +693,9 @@ equal(void *a, void *b)
case
T_IndexScan
:
retval
=
_equalIndexScan
(
a
,
b
);
break
;
case
T_SubPlan
:
retval
=
_equalSubPlan
(
a
,
b
);
break
;
case
T_JInfo
:
retval
=
_equalJInfo
(
a
,
b
);
break
;
...
...
src/backend/nodes/outfuncs.c
View file @
dc892fd3
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.
29 1998/02/10 16:03:21 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.
30 1998/02/13 03:27:45 vadim
Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
...
...
@@ -288,7 +288,14 @@ _outPlanInfo(StringInfo str, Plan *node)
_outNode
(
str
,
node
->
lefttree
);
appendStringInfo
(
str
,
" :righttree "
);
_outNode
(
str
,
node
->
righttree
);
appendStringInfo
(
str
,
" :extprm "
);
_outIntList
(
str
,
node
->
extParam
);
appendStringInfo
(
str
,
" :locprm "
);
_outIntList
(
str
,
node
->
locParam
);
appendStringInfo
(
str
,
" :initplan "
);
_outNode
(
str
,
node
->
initPlan
);
sprintf
(
buf
,
" :nprm %d "
,
node
->
nParamExec
);
appendStringInfo
(
str
,
buf
);
}
/*
...
...
@@ -408,6 +415,26 @@ _outHashJoin(StringInfo str, HashJoin *node)
appendStringInfo
(
str
,
buf
);
}
static
void
_outSubPlan
(
StringInfo
str
,
SubPlan
*
node
)
{
char
buf
[
500
];
appendStringInfo
(
str
,
"SUBPLAN"
);
appendStringInfo
(
str
,
" :plan "
);
_outNode
(
str
,
node
->
plan
);
sprintf
(
buf
,
" :planid %u "
,
node
->
plan_id
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" :rtable "
);
_outNode
(
str
,
node
->
rtable
);
appendStringInfo
(
str
,
" :setprm "
);
_outIntList
(
str
,
node
->
setParam
);
appendStringInfo
(
str
,
" :parprm "
);
_outIntList
(
str
,
node
->
parParam
);
appendStringInfo
(
str
,
" :slink "
);
_outNode
(
str
,
node
->
sublink
);
}
/*
* Scan is a subclass of Node
*/
...
...
@@ -674,6 +701,9 @@ _outExpr(StringInfo str, Expr *node)
case
NOT_EXPR
:
opstr
=
"not"
;
break
;
case
SUBPLAN_EXPR
:
opstr
=
"subp"
;
break
;
}
appendStringInfo
(
str
,
" :opType "
);
appendStringInfo
(
str
,
opstr
);
...
...
@@ -1654,6 +1684,9 @@ _outNode(StringInfo str, void *obj)
case
T_Hash
:
_outHash
(
str
,
obj
);
break
;
case
T_SubPlan
:
_outSubPlan
(
str
,
obj
);
break
;
case
T_Tee
:
_outTee
(
str
,
obj
);
break
;
...
...
src/backend/nodes/readfuncs.c
View file @
dc892fd3
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.2
4 1998/02/10 16:03:23 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.2
5 1998/02/13 03:27:47 vadim
Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
...
...
@@ -777,6 +777,10 @@ _readExpr()
{
local_node
->
opType
=
NOT_EXPR
;
}
else
if
(
!
strncmp
(
token
,
"subp"
,
4
))
{
local_node
->
opType
=
SUBPLAN_EXPR
;
}
token
=
lsptok
(
NULL
,
&
length
);
/* eat :oper */
local_node
->
oper
=
nodeRead
(
true
);
...
...
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