Skip to content

Commit bab2bd9

Browse files
committed
implement needs_fmgr_hook
Signed-off-by: Tanzeel Khan <tzlkhan@amazon.com>
1 parent cfc65c3 commit bab2bd9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

contrib/babelfishpg_tsql/src/pl_handler.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ extern Datum init_tsql_cursor_hash_tab(PG_FUNCTION_ARGS);
117117
extern PLtsql_execstate *get_current_tsql_estate(void);
118118
extern PLtsql_execstate *get_outermost_tsql_estate(int *nestlevel);
119119
extern void pre_check_trigger_schema(List *object, bool missing_ok);
120+
static bool pltsql_needs_fmgr_hook(Oid funcoid);
120121
static void get_language_procs(const char *langname, Oid *compiler, Oid *validator);
121122
static void get_func_language_oids(Oid *lang_handler, Oid *lang_validator);
122123
extern bool pltsql_suppress_string_truncation_error();
@@ -292,6 +293,7 @@ planner_node_transformer_hook_type prev_planner_node_transformer_hook = NULL;
292293
pltsql_nextval_hook_type prev_pltsql_nextval_hook = NULL;
293294
pltsql_resetcache_hook_type prev_pltsql_resetcache_hook = NULL;
294295
pltsql_setval_hook_type prev_pltsql_setval_hook = NULL;
296+
static needs_fmgr_hook_type prev_needs_fmgr_hook = NULL;
295297

296298
static void
297299
set_procid(Oid oid)
@@ -5467,6 +5469,9 @@ _PG_init(void)
54675469

54685470
check_pltsql_support_tsql_transactions_hook = pltsql_support_tsql_transactions;
54695471

5472+
prev_needs_fmgr_hook = needs_fmgr_hook;
5473+
needs_fmgr_hook = pltsql_needs_fmgr_hook;
5474+
54705475
inited = true;
54715476
}
54725477

@@ -5493,6 +5498,7 @@ _PG_fini(void)
54935498
non_tsql_proc_entry_hook = prev_non_tsql_proc_entry_hook;
54945499
get_func_language_oids_hook = prev_get_func_language_oids_hook;
54955500
tsql_has_linked_srv_permissions_hook = prev_tsql_has_linked_srv_permissions_hook;
5501+
needs_fmgr_hook = prev_needs_fmgr_hook;
54965502

54975503
UninstallExtendedHooks();
54985504
}
@@ -6524,6 +6530,12 @@ pltsql_validator(PG_FUNCTION_ARGS)
65246530
PG_RETURN_VOID();
65256531
}
65266532

6533+
static bool
6534+
pltsql_needs_fmgr_hook(Oid funcoid)
6535+
{
6536+
return true;
6537+
}
6538+
65276539
/*
65286540
* Returns the OID of the handler proc, and, if defined, the OID of the
65296541
* validator for the given language

0 commit comments

Comments
 (0)