|
|
|
@ -423,8 +423,8 @@ plpgsql_exec_function(PLpgSQL_function *func, FunctionCallInfo fcinfo, |
|
|
|
|
/*
|
|
|
|
|
* Let the instrumentation plugin peek at this function |
|
|
|
|
*/ |
|
|
|
|
if (*plugin_ptr && (*plugin_ptr)->func_beg) |
|
|
|
|
((*plugin_ptr)->func_beg) (&estate, func); |
|
|
|
|
if (*plpgsql_plugin_ptr && (*plpgsql_plugin_ptr)->func_beg) |
|
|
|
|
((*plpgsql_plugin_ptr)->func_beg) (&estate, func); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Now call the toplevel block of statements |
|
|
|
@ -556,8 +556,8 @@ plpgsql_exec_function(PLpgSQL_function *func, FunctionCallInfo fcinfo, |
|
|
|
|
/*
|
|
|
|
|
* Let the instrumentation plugin peek at this function |
|
|
|
|
*/ |
|
|
|
|
if (*plugin_ptr && (*plugin_ptr)->func_end) |
|
|
|
|
((*plugin_ptr)->func_end) (&estate, func); |
|
|
|
|
if (*plpgsql_plugin_ptr && (*plpgsql_plugin_ptr)->func_end) |
|
|
|
|
((*plpgsql_plugin_ptr)->func_end) (&estate, func); |
|
|
|
|
|
|
|
|
|
/* Clean up any leftover temporary memory */ |
|
|
|
|
plpgsql_destroy_econtext(&estate); |
|
|
|
@ -767,8 +767,8 @@ plpgsql_exec_trigger(PLpgSQL_function *func, |
|
|
|
|
/*
|
|
|
|
|
* Let the instrumentation plugin peek at this function |
|
|
|
|
*/ |
|
|
|
|
if (*plugin_ptr && (*plugin_ptr)->func_beg) |
|
|
|
|
((*plugin_ptr)->func_beg) (&estate, func); |
|
|
|
|
if (*plpgsql_plugin_ptr && (*plpgsql_plugin_ptr)->func_beg) |
|
|
|
|
((*plpgsql_plugin_ptr)->func_beg) (&estate, func); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Now call the toplevel block of statements |
|
|
|
@ -826,8 +826,8 @@ plpgsql_exec_trigger(PLpgSQL_function *func, |
|
|
|
|
/*
|
|
|
|
|
* Let the instrumentation plugin peek at this function |
|
|
|
|
*/ |
|
|
|
|
if (*plugin_ptr && (*plugin_ptr)->func_end) |
|
|
|
|
((*plugin_ptr)->func_end) (&estate, func); |
|
|
|
|
if (*plpgsql_plugin_ptr && (*plpgsql_plugin_ptr)->func_end) |
|
|
|
|
((*plpgsql_plugin_ptr)->func_end) (&estate, func); |
|
|
|
|
|
|
|
|
|
/* Clean up any leftover temporary memory */ |
|
|
|
|
plpgsql_destroy_econtext(&estate); |
|
|
|
@ -885,8 +885,8 @@ plpgsql_exec_event_trigger(PLpgSQL_function *func, EventTriggerData *trigdata) |
|
|
|
|
/*
|
|
|
|
|
* Let the instrumentation plugin peek at this function |
|
|
|
|
*/ |
|
|
|
|
if (*plugin_ptr && (*plugin_ptr)->func_beg) |
|
|
|
|
((*plugin_ptr)->func_beg) (&estate, func); |
|
|
|
|
if (*plpgsql_plugin_ptr && (*plpgsql_plugin_ptr)->func_beg) |
|
|
|
|
((*plpgsql_plugin_ptr)->func_beg) (&estate, func); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Now call the toplevel block of statements |
|
|
|
@ -909,8 +909,8 @@ plpgsql_exec_event_trigger(PLpgSQL_function *func, EventTriggerData *trigdata) |
|
|
|
|
/*
|
|
|
|
|
* Let the instrumentation plugin peek at this function |
|
|
|
|
*/ |
|
|
|
|
if (*plugin_ptr && (*plugin_ptr)->func_end) |
|
|
|
|
((*plugin_ptr)->func_end) (&estate, func); |
|
|
|
|
if (*plpgsql_plugin_ptr && (*plpgsql_plugin_ptr)->func_end) |
|
|
|
|
((*plpgsql_plugin_ptr)->func_end) (&estate, func); |
|
|
|
|
|
|
|
|
|
/* Clean up any leftover temporary memory */ |
|
|
|
|
plpgsql_destroy_econtext(&estate); |
|
|
|
@ -1420,8 +1420,8 @@ exec_stmt(PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt) |
|
|
|
|
estate->err_stmt = stmt; |
|
|
|
|
|
|
|
|
|
/* Let the plugin know that we are about to execute this statement */ |
|
|
|
|
if (*plugin_ptr && (*plugin_ptr)->stmt_beg) |
|
|
|
|
((*plugin_ptr)->stmt_beg) (estate, stmt); |
|
|
|
|
if (*plpgsql_plugin_ptr && (*plpgsql_plugin_ptr)->stmt_beg) |
|
|
|
|
((*plpgsql_plugin_ptr)->stmt_beg) (estate, stmt); |
|
|
|
|
|
|
|
|
|
CHECK_FOR_INTERRUPTS(); |
|
|
|
|
|
|
|
|
@ -1529,8 +1529,8 @@ exec_stmt(PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Let the plugin know that we have finished executing this statement */ |
|
|
|
|
if (*plugin_ptr && (*plugin_ptr)->stmt_end) |
|
|
|
|
((*plugin_ptr)->stmt_end) (estate, stmt); |
|
|
|
|
if (*plpgsql_plugin_ptr && (*plpgsql_plugin_ptr)->stmt_end) |
|
|
|
|
((*plpgsql_plugin_ptr)->stmt_end) (estate, stmt); |
|
|
|
|
|
|
|
|
|
estate->err_stmt = save_estmt; |
|
|
|
|
|
|
|
|
@ -2315,7 +2315,7 @@ exec_stmt_foreach_a(PLpgSQL_execstate *estate, PLpgSQL_stmt_foreach_a *stmt) |
|
|
|
|
loop_var_elem_type = InvalidOid; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
loop_var_elem_type = get_element_type(exec_get_datum_type(estate, |
|
|
|
|
loop_var_elem_type = get_element_type(plpgsql_exec_get_datum_type(estate, |
|
|
|
|
loop_var)); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -3350,13 +3350,13 @@ plpgsql_estate_setup(PLpgSQL_execstate *estate, |
|
|
|
|
* pointers so it can call back into PL/pgSQL for doing things like |
|
|
|
|
* variable assignments and stack traces |
|
|
|
|
*/ |
|
|
|
|
if (*plugin_ptr) |
|
|
|
|
if (*plpgsql_plugin_ptr) |
|
|
|
|
{ |
|
|
|
|
(*plugin_ptr)->error_callback = plpgsql_exec_error_callback; |
|
|
|
|
(*plugin_ptr)->assign_expr = exec_assign_expr; |
|
|
|
|
(*plpgsql_plugin_ptr)->error_callback = plpgsql_exec_error_callback; |
|
|
|
|
(*plpgsql_plugin_ptr)->assign_expr = exec_assign_expr; |
|
|
|
|
|
|
|
|
|
if ((*plugin_ptr)->func_setup) |
|
|
|
|
((*plugin_ptr)->func_setup) (estate, func); |
|
|
|
|
if ((*plpgsql_plugin_ptr)->func_setup) |
|
|
|
|
((*plpgsql_plugin_ptr)->func_setup) (estate, func); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4758,7 +4758,7 @@ exec_eval_datum(PLpgSQL_execstate *estate, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* exec_get_datum_type Get datatype of a PLpgSQL_datum |
|
|
|
|
* plpgsql_exec_get_datum_type Get datatype of a PLpgSQL_datum |
|
|
|
|
* |
|
|
|
|
* This is the same logic as in exec_eval_datum, except that it can handle |
|
|
|
|
* some cases where exec_eval_datum has to fail; specifically, we may have |
|
|
|
@ -4766,7 +4766,7 @@ exec_eval_datum(PLpgSQL_execstate *estate, |
|
|
|
|
* happen only for a trigger's NEW/OLD records.) |
|
|
|
|
*/ |
|
|
|
|
Oid |
|
|
|
|
exec_get_datum_type(PLpgSQL_execstate *estate, |
|
|
|
|
plpgsql_exec_get_datum_type(PLpgSQL_execstate *estate, |
|
|
|
|
PLpgSQL_datum *datum) |
|
|
|
|
{ |
|
|
|
|
Oid typeid; |
|
|
|
@ -4842,13 +4842,13 @@ exec_get_datum_type(PLpgSQL_execstate *estate, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* exec_get_datum_type_info Get datatype etc of a PLpgSQL_datum |
|
|
|
|
* plpgsql_exec_get_datum_type_info Get datatype etc of a PLpgSQL_datum |
|
|
|
|
* |
|
|
|
|
* An extended version of exec_get_datum_type, which also retrieves the |
|
|
|
|
* An extended version of plpgsql_exec_get_datum_type, which also retrieves the |
|
|
|
|
* typmod and collation of the datum. |
|
|
|
|
*/ |
|
|
|
|
void |
|
|
|
|
exec_get_datum_type_info(PLpgSQL_execstate *estate, |
|
|
|
|
plpgsql_exec_get_datum_type_info(PLpgSQL_execstate *estate, |
|
|
|
|
PLpgSQL_datum *datum, |
|
|
|
|
Oid *typeid, int32 *typmod, Oid *collation) |
|
|
|
|
{ |
|
|
|
|