Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Tanzeel Khan <[email protected]>
  • Loading branch information
tanscorpio7 committed Oct 16, 2023
1 parent 40938ca commit 400ab45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/backend/utils/fmgr/fmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ PGDLLIMPORT fmgr_hook_type fmgr_hook = NULL;
PGDLLIMPORT non_tsql_proc_entry_hook_type non_tsql_proc_entry_hook = NULL;
PGDLLIMPORT get_func_language_oids_hook_type get_func_language_oids_hook = NULL;
PGDLLIMPORT pgstat_function_wrapper_hook_type pgstat_function_wrapper_hook = NULL;
set_local_schema_for_func_hookType set_local_schema_for_func_hook;
set_local_schema_for_func_hook_type set_local_schema_for_func_hook;

/*
* Hashtable for fast lookup of external C functions
Expand Down Expand Up @@ -719,7 +719,6 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
pltsql_validator_oid = InvalidOid;
}

// get_language_procs("pltsql", &pltsql_lang_oid, &pltsql_validator_oid);
set_sql_dialect = pltsql_lang_oid != InvalidOid;

if (!fcinfo->flinfo->fn_extra)
Expand Down Expand Up @@ -804,9 +803,9 @@ fmgr_security_definer(PG_FUNCTION_ARGS)

if (fcache->prosearchpath)
{
old_search_path = namespace_search_path;
namespace_search_path = fcache->prosearchpath;
assign_search_path(fcache->prosearchpath, newextra);
old_search_path = namespace_search_path;
namespace_search_path = fcache->prosearchpath;
assign_search_path(fcache->prosearchpath, newextra);
}

if (set_sql_dialect && IsTransactionState())
Expand Down Expand Up @@ -917,7 +916,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)

fcinfo->flinfo = save_flinfo;

if(old_search_path)
if (old_search_path)
{
namespace_search_path = old_search_path;
assign_search_path(old_search_path, newextra);
Expand Down
4 changes: 2 additions & 2 deletions src/include/fmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,8 @@ typedef void (*non_tsql_proc_entry_hook_type) (int, int);

typedef void (*get_func_language_oids_hook_type)(Oid *, Oid *);

typedef char *(*set_local_schema_for_func_hookType) (Oid proc_nsp_oid);
extern set_local_schema_for_func_hookType set_local_schema_for_func_hook;
typedef char *(*set_local_schema_for_func_hook_type) (Oid proc_nsp_oid);
extern set_local_schema_for_func_hook_type set_local_schema_for_func_hook;

extern PGDLLIMPORT needs_fmgr_hook_type needs_fmgr_hook;
extern PGDLLIMPORT fmgr_hook_type fmgr_hook;
Expand Down

0 comments on commit 400ab45

Please sign in to comment.