-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for cache reference leak warning #3161
Open
pranavJ23
wants to merge
24
commits into
babelfish-for-postgresql:BABEL_4_X_DEV
Choose a base branch
from
pranavJ23:babel_4939
base: BABEL_4_X_DEV
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28
−7
Open
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0b19b31
enabling extensive logfile
e9cb341
Merge branch 'babelfish-for-postgresql:BABEL_4_X_DEV' into babel_4939
pranavJ23 1d9d445
fix
99ce7cf
temporarily removing secondary server
b316b08
testing
1faacd2
testing
ea1ca04
try changes to get full logfile
ff523d2
fix
pranavJ23 71f8a71
minor fix
pranavJ23 5ba4747
adding changes for warning in right function
pranavJ23 7e5d728
Merge branch 'babelfish-for-postgresql:BABEL_4_X_DEV' into babel_4939
pranavJ23 0bc02af
cleaning up the code
pranavJ23 1bcc0d9
Merge branch 'babelfish-for-postgresql:BABEL_4_X_DEV' into babel_4939
pranavJ23 2a866cd
Merge remote-tracking branch 'origin/BABEL_4_X_DEV' into babel_4939
pranavJ23 5dea611
Merge remote-tracking branch 'origin/babel_4939' into babel_4939
pranavJ23 9c3307c
minor changes
pranavJ23 9e8fc56
enabling the secondary server data dir
pranavJ23 475dc4d
minor changes
pranavJ23 a305d25
changing the location of logfile
pranavJ23 487c2ad
minor changes
pranavJ23 34f9e05
minor changes
pranavJ23 da7b618
adding failure step for leak
pranavJ23 c279b6e
Merge remote-tracking branch 'upstream/BABEL_4_X_DEV' into babel_4939
pranavJ23 b888462
addressing comments
pranavJ23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2519,6 +2519,7 @@ bbf_ProcessUtility(PlannedStmt *pstmt, | |
bool with_recompile = false; | ||
Node *tbltypStmt = NULL; | ||
ListCell *parameter; | ||
HeapTuple proctup; | ||
|
||
cfs = makeNode(CreateFunctionStmt); | ||
cfs->returnType = NULL; | ||
|
@@ -2600,13 +2601,26 @@ bbf_ProcessUtility(PlannedStmt *pstmt, | |
originalFunc.objectId = oldoid; | ||
originalFunc.classId = ProcedureRelationId; | ||
originalFunc.objectSubId = 0; | ||
if(get_bbf_function_tuple_from_proctuple(SearchSysCache1(PROCOID, ObjectIdGetDatum(oldoid))) == NULL) | ||
proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(oldoid)); | ||
|
||
if (proctup == NULL) | ||
{ | ||
/* Detect PSQL functions and throw error */ | ||
ereport(ERROR, | ||
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), | ||
errmsg("No existing TSQL procedure found with the name for ALTER PROCEDURE"))); | ||
ereport(ERROR, | ||
(errcode(ERRCODE_UNDEFINED_OBJECT), | ||
errmsg("cache lookup failed for procedure %u", oldoid))); | ||
} | ||
if (get_bbf_function_tuple_from_proctuple(proctup) == NULL) | ||
{ | ||
/* Release the tuple before reporting the error */ | ||
ReleaseSysCache(proctup); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case of error we do not need to release syscache |
||
|
||
/* Detect PSQL functions and throw error */ | ||
ereport(ERROR, | ||
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), | ||
errmsg("No existing TSQL procedure found with the name for ALTER PROCEDURE"))); | ||
} | ||
ReleaseSysCache(proctup); | ||
|
||
if(!cfs->is_procedure) | ||
{ | ||
/* | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should use
HeapTupleIsValid
& curly braces can be removed in next line.