Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: pranav jain <[email protected]>
  • Loading branch information
pranavJ23 committed Jan 22, 2025
1 parent c279b6e commit b888462
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions contrib/babelfishpg_tsql/src/pl_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2603,17 +2603,14 @@ bbf_ProcessUtility(PlannedStmt *pstmt,
originalFunc.objectSubId = 0;
proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(oldoid));

if (proctup == NULL)
if (!HeapTupleIsValid(proctup))
{
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);

/* Detect PSQL functions and throw error */
ereport(ERROR,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
Expand Down

0 comments on commit b888462

Please sign in to comment.