Skip to content

Commit

Permalink
Clean up temp table naming, introduce new functions for readability
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Chang <[email protected]>
  • Loading branch information
timchang514 committed Sep 25, 2024
1 parent 38259e3 commit 331e169
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contrib/babelfishpg_tsql/runtime/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,7 @@ object_name(PG_FUNCTION_ARGS)
* search in list of ENRs registered in the current query environment by
* object_id
*/
enr = get_ENR_withoid(currentQueryEnv, object_id, ENR_TSQL_TEMP);
enr = OidBelongsToENRTempTable(object_id);
if (enr != NULL && enr->md.enrtype == ENR_TSQL_TEMP)
{
PG_RETURN_VARCHAR_P((VarChar *) cstring_to_text(enr->md.name));
Expand Down
2 changes: 1 addition & 1 deletion contrib/babelfishpg_tsql/src/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -4797,7 +4797,7 @@ pltsql_is_local_only_inval_msg(const SharedInvalidationMessage *msg)
static EphemeralNamedRelation
pltsql_get_tsql_enr_from_oid(const Oid oid)
{
return temp_oid_buffer_size > 0 ? get_ENR_withoid(currentQueryEnv, oid, ENR_TSQL_TEMP) : NULL;
return temp_oid_buffer_size > 0 ? OidBelongsToENRTempTable(oid) : NULL;
}

/*
Expand Down

0 comments on commit 331e169

Please sign in to comment.