33#ifndef srv0dynamic_procedures_h
34#define srv0dynamic_procedures_h
113 const char *
name = procedure.m_name.c_str();
114 if (registrar->udf_register(
name, procedure.m_return_type,
115 procedure.m_func, procedure.m_init_func,
116 procedure.m_deinit_func)) {
120 ": Cannot register dynamic SQL procedure '" +
148 const char *
name = procedure.m_name.c_str();
150 if (registrar->udf_unregister(
name, &was_present) && was_present) {
154 ": Cannot unregister dynamic SQL procedure '" +
172 if (plugin_registry ==
nullptr) {
180 return plugin_registry;
Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service...
Definition: my_service.h:35
bool is_valid() const
Definition: my_service.h:104
Definition: srv0dynamic_procedures.h:90
const mysql_service_registry_t * get_mysql_registry()
Definition: srv0dynamic_procedures.h:170
virtual std::string get_module_name() const =0
virtual ~Dynamic_procedures()=default
void unregister()
Unregister dynamic SQL procedure.
Definition: srv0dynamic_procedures.h:138
my_service< const mysql_service_udf_registration_t > get_procedure_registar(const mysql_service_registry_t *plugin_registry)
Definition: srv0dynamic_procedures.h:183
bool register_procedures()
Register dynamic SQL procedure.
Definition: srv0dynamic_procedures.h:99
virtual std::vector< dynamic_procedure_data_t > get_procedures() const =0
#define LogErr(severity, ecode,...)
Definition: log_builtins.h:843
@ WARNING_LEVEL
Definition: my_loglevel.h:44
@ ERROR_LEVEL
Definition: my_loglevel.h:43
Definition: srv0dynamic_procedures.h:48
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
Declaration of the registry plugin service.
const mysql_service_registry_t * mysql_plugin_registry_acquire()
Returns a new reference to the "registry" service.
Definition: plugin_registry_service.cc:47
int mysql_plugin_registry_release(const mysql_service_registry_t *)
Releases a registry service reference.
Definition: plugin_registry_service.cc:75
case opt name
Definition: sslopt-case.h:29
Type and data for tracking registered UDFs.
Definition: srv0dynamic_procedures.h:53
const Udf_func_init m_init_func
Definition: srv0dynamic_procedures.h:57
const Item_result m_return_type
Definition: srv0dynamic_procedures.h:55
const Udf_func_deinit m_deinit_func
Definition: srv0dynamic_procedures.h:58
const Udf_func_any m_func
Definition: srv0dynamic_procedures.h:56
dynamic_procedure_data_t(const std::string &name, const Udf_func_double func, const Udf_func_init init_func, const Udf_func_deinit deinit_func)
Definition: srv0dynamic_procedures.h:80
const std::string m_name
Definition: srv0dynamic_procedures.h:54
dynamic_procedure_data_t(const std::string &name, const Udf_func_longlong func, const Udf_func_init init_func, const Udf_func_deinit deinit_func)
Definition: srv0dynamic_procedures.h:70
dynamic_procedure_data_t(const std::string &name, const Udf_func_string func, const Udf_func_init init_func, const Udf_func_deinit deinit_func, const Item_result return_type=STRING_RESULT)
Definition: srv0dynamic_procedures.h:60
long long(* Udf_func_longlong)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:85
char *(* Udf_func_string)(UDF_INIT *, UDF_ARGS *, char *, unsigned long *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:87
void(* Udf_func_deinit)(UDF_INIT *)
Definition: udf_registration_types.h:80
double(* Udf_func_double)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:83
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:39
@ STRING_RESULT
not valid for UDFs
Definition: udf_registration_types.h:41
@ REAL_RESULT
char *
Definition: udf_registration_types.h:42
@ INT_RESULT
double
Definition: udf_registration_types.h:43
bool(* Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *)
Definition: udf_registration_types.h:81
void(* Udf_func_any)(void)
Definition: udf_registration_types.h:82
Version control for database, common definitions, and include files.