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
ff7da2f4
Commit
ff7da2f4
authored
Jul 27, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make planner safe for recursive calls --- needed for cases where
eval_const_expressions tries to simplify an SQL function.
parent
faa41717
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
54 deletions
+32
-54
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/indxpath.c
+2
-2
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/planner.c
+23
-1
src/backend/optimizer/util/plancat.c
src/backend/optimizer/util/plancat.c
+7
-51
No files found.
src/backend/optimizer/path/indxpath.c
View file @
ff7da2f4
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.
89 2000/07/26 23:46:22
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.
90 2000/07/27 23:15:56
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1153,7 +1153,7 @@ one_pred_clause_test(Expr *predicate, Node *clause)
* this test should always be considered false.
*/
static
StrategyNumber
static
const
StrategyNumber
BT_implic_table
[
BTMaxStrategyNumber
][
BTMaxStrategyNumber
]
=
{
{
2
,
2
,
0
,
0
,
0
},
{
1
,
2
,
0
,
0
,
0
},
...
...
src/backend/optimizer/plan/planner.c
View file @
ff7da2f4
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.8
5 2000/06/20 04:22:21
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.8
6 2000/07/27 23:15:57
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -50,6 +50,22 @@ Plan *
planner
(
Query
*
parse
)
{
Plan
*
result_plan
;
Index
save_PlannerQueryLevel
;
List
*
save_PlannerInitPlan
;
List
*
save_PlannerParamVar
;
int
save_PlannerPlanId
;
/*
* The planner can be called recursively (an example is when
* eval_const_expressions tries to simplify an SQL function).
* So, global state variables must be saved and restored.
*
* (Perhaps these should be moved into the Query structure instead?)
*/
save_PlannerQueryLevel
=
PlannerQueryLevel
;
save_PlannerInitPlan
=
PlannerInitPlan
;
save_PlannerParamVar
=
PlannerParamVar
;
save_PlannerPlanId
=
PlannerPlanId
;
/* Initialize state for subselects */
PlannerQueryLevel
=
1
;
...
...
@@ -78,6 +94,12 @@ planner(Query *parse)
/* final cleanup of the plan */
set_plan_references
(
result_plan
);
/* restore state for outer planner, if any */
PlannerQueryLevel
=
save_PlannerQueryLevel
;
PlannerInitPlan
=
save_PlannerInitPlan
;
PlannerParamVar
=
save_PlannerParamVar
;
PlannerPlanId
=
save_PlannerPlanId
;
return
result_plan
;
}
...
...
src/backend/optimizer/util/plancat.c
View file @
ff7da2f4
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.
59 2000/07/05 23:11:26
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.
60 2000/07/27 23:16:04
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -272,15 +272,12 @@ join_selectivity(Oid functionObjectId,
List
*
find_inheritance_children
(
Oid
inhparent
)
{
static
ScanKeyData
key
[
1
]
=
{
{
0
,
Anum_pg_inherits_inhparent
,
F_OIDEQ
}
};
List
*
list
=
NIL
;
Relation
relation
;
HeapScanDesc
scan
;
HeapTuple
inheritsTuple
;
Oid
inhrelid
;
ScanKeyData
key
[
1
];
/*
* Can skip the scan if pg_class shows the relation has never had
...
...
@@ -289,10 +286,11 @@ find_inheritance_children(Oid inhparent)
if
(
!
has_subclass
(
inhparent
))
return
NIL
;
fmgr_info
(
F_OIDEQ
,
&
key
[
0
].
sk_func
);
key
[
0
].
sk_nargs
=
key
[
0
].
sk_func
.
fn_nargs
;
key
[
0
].
sk_argument
=
ObjectIdGetDatum
(
inhparent
);
ScanKeyEntryInitialize
(
&
key
[
0
],
(
bits16
)
0x0
,
(
AttrNumber
)
Anum_pg_inherits_inhparent
,
(
RegProcedure
)
F_OIDEQ
,
ObjectIdGetDatum
(
inhparent
));
relation
=
heap_openr
(
InheritsRelationName
,
AccessShareLock
);
scan
=
heap_beginscan
(
relation
,
0
,
SnapshotNow
,
1
,
key
);
while
(
HeapTupleIsValid
(
inheritsTuple
=
heap_getnext
(
scan
,
0
)))
...
...
@@ -330,45 +328,3 @@ has_subclass(Oid relationId)
relationId
);
return
((
Form_pg_class
)
GETSTRUCT
(
tuple
))
->
relhassubclass
;
}
#ifdef NOT_USED
/*
* VersionGetParents
*
* Returns a LISP list containing the OIDs of all relations which are
* base relations of the relation with OID 'verrelid'.
*/
List
*
VersionGetParents
(
Oid
verrelid
)
{
static
ScanKeyData
key
[
1
]
=
{
{
0
,
Anum_pg_version_verrelid
,
F_OIDEQ
}
};
HeapTuple
versionTuple
;
Relation
relation
;
HeapScanDesc
scan
;
Oid
verbaseid
;
List
*
list
=
NIL
;
fmgr_info
(
F_OIDEQ
,
&
key
[
0
].
sk_func
);
key
[
0
].
sk_nargs
=
key
[
0
].
sk_func
.
fn_nargs
;
key
[
0
].
sk_argument
=
ObjectIdGetDatum
(
verrelid
);
relation
=
heap_openr
(
VersionRelationName
,
AccessShareLock
);
scan
=
heap_beginscan
(
relation
,
0
,
SnapshotNow
,
1
,
key
);
while
(
HeapTupleIsValid
(
versionTuple
=
heap_getnext
(
scan
,
0
)))
{
verbaseid
=
((
Form_pg_version
)
GETSTRUCT
(
versionTuple
))
->
verbaseid
;
list
=
lconsi
(
verbaseid
,
list
);
key
[
0
].
sk_argument
=
ObjectIdGetDatum
(
verbaseid
);
heap_rescan
(
scan
,
0
,
key
);
}
heap_endscan
(
scan
);
heap_close
(
relation
,
AccessShareLock
);
return
list
;
}
#endif
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