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
f6f8ca49
Commit
f6f8ca49
authored
Oct 24, 1996
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes: Growing backend when using nested function calls
Submitted by: wieck@sapserv.debis.de (Jan Wieck)
parent
20b4c46e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
src/backend/utils/cache/catcache.c
src/backend/utils/cache/catcache.c
+32
-1
No files found.
src/backend/utils/cache/catcache.c
View file @
f6f8ca49
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.
2 1996/10/13 18:38:51 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.
3 1996/10/24 07:59:46 scrappy
Exp $
*
*
* Notes:
* Notes:
* XXX This needs to use exception.h to handle recovery when
* XXX This needs to use exception.h to handle recovery when
...
@@ -860,6 +860,13 @@ SearchSysCache(struct catcache *cache,
...
@@ -860,6 +860,13 @@ SearchSysCache(struct catcache *cache,
if
((
RelationGetRelationTupleForm
(
relation
))
->
relhasindex
if
((
RelationGetRelationTupleForm
(
relation
))
->
relhasindex
&&
!
IsBootstrapProcessingMode
())
&&
!
IsBootstrapProcessingMode
())
{
{
/* ----------
* Switch back to old memory context so memory not freed
* in the scan function will go away at transaction end.
* wieck - 10/18/1996
* ----------
*/
MemoryContextSwitchTo
(
oldcxt
);
Assert
(
cache
->
cc_iscanfunc
);
Assert
(
cache
->
cc_iscanfunc
);
switch
(
cache
->
cc_nkeys
)
switch
(
cache
->
cc_nkeys
)
{
{
...
@@ -868,22 +875,46 @@ SearchSysCache(struct catcache *cache,
...
@@ -868,22 +875,46 @@ SearchSysCache(struct catcache *cache,
case
2
:
ntp
=
cache
->
cc_iscanfunc
(
relation
,
v1
,
v2
);
break
;
case
2
:
ntp
=
cache
->
cc_iscanfunc
(
relation
,
v1
,
v2
);
break
;
case
1
:
ntp
=
cache
->
cc_iscanfunc
(
relation
,
v1
);
break
;
case
1
:
ntp
=
cache
->
cc_iscanfunc
(
relation
,
v1
);
break
;
}
}
/* ----------
* Back to Cache context. If we got a tuple copy it
* into our context.
* wieck - 10/18/1996
* ----------
*/
MemoryContextSwitchTo
((
MemoryContext
)
CacheCxt
);
if
(
HeapTupleIsValid
(
ntp
))
{
ntp
=
heap_copytuple
(
ntp
);
}
}
}
else
else
{
{
HeapScanDesc
sd
;
HeapScanDesc
sd
;
/* ----------
* As above do the lookup in the callers memory
* context.
* wieck - 10/18/1996
* ----------
*/
MemoryContextSwitchTo
(
oldcxt
);
sd
=
heap_beginscan
(
relation
,
0
,
NowTimeQual
,
sd
=
heap_beginscan
(
relation
,
0
,
NowTimeQual
,
cache
->
cc_nkeys
,
cache
->
cc_skey
);
cache
->
cc_nkeys
,
cache
->
cc_skey
);
ntp
=
heap_getnext
(
sd
,
0
,
&
buffer
);
ntp
=
heap_getnext
(
sd
,
0
,
&
buffer
);
MemoryContextSwitchTo
((
MemoryContext
)
CacheCxt
);
if
(
HeapTupleIsValid
(
ntp
))
{
if
(
HeapTupleIsValid
(
ntp
))
{
CACHE1_elog
(
DEBUG
,
"SearchSysCache: found tuple"
);
CACHE1_elog
(
DEBUG
,
"SearchSysCache: found tuple"
);
ntp
=
heap_copytuple
(
ntp
);
ntp
=
heap_copytuple
(
ntp
);
}
}
MemoryContextSwitchTo
(
oldcxt
);
heap_endscan
(
sd
);
heap_endscan
(
sd
);
MemoryContextSwitchTo
((
MemoryContext
)
CacheCxt
);
}
}
DisableCache
=
0
;
DisableCache
=
0
;
...
...
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