MySQL 9.1.0
Source Code Documentation
sql_plugin_services.h File Reference
#include "mysql/services.h"
#include "service_versions.h"

Go to the source code of this file.

Classes

struct  st_service_ref
 A server-side reference to a plugin service. More...
 

Variables

static struct srv_session_service_st srv_session_service_handler
 
static struct command_service_st command_handler
 
static struct srv_session_info_service_st srv_session_info_handler
 
static struct thd_alloc_service_st thd_alloc_handler
 
static struct thd_wait_service_st thd_wait_handler
 
static struct my_thread_scheduler_service my_thread_scheduler_handler
 
static struct my_plugin_log_service my_plugin_log_handler
 
static struct mysql_string_service_st mysql_string_handler
 
static struct mysql_malloc_service_st mysql_malloc_handler
 
static struct mysql_password_policy_service_st mysql_password_policy_handler
 
static struct mysql_parser_service_st parser_handler
 
static struct rpl_transaction_ctx_service_st rpl_transaction_ctx_handler
 
static struct transaction_write_set_service_st transaction_write_set_handler
 
static struct mysql_locking_service_st locking_service_handler
 
static struct security_context_service_st security_context_handler
 
static struct mysql_keyring_service_st mysql_keyring_handler
 
static struct plugin_registry_service_st plugin_registry_handler
 
static struct st_service_ref list_of_services []
 

Variable Documentation

◆ command_handler

struct command_service_st command_handler
static
Initial value:
= {
}
int command_service_run_command(MYSQL_SESSION session, enum enum_server_command command, const union COM_DATA *data, const CHARSET_INFO *client_cs, const struct st_command_service_cbs *callbacks, enum cs_text_or_binary text_or_binary, void *service_callbacks_ctx)
Executes a server command in a session.

◆ list_of_services

struct st_service_ref list_of_services[]
static
Initial value:
= {
{"srv_session_service", VERSION_srv_session_service,
{"command_service", VERSION_command, &command_handler},
{"srv_session_info_service", VERSION_srv_session_info_service,
{"thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler},
{"thd_wait_service", VERSION_thd_wait, &thd_wait_handler},
{"my_thread_scheduler_service", VERSION_my_thread_scheduler,
{"my_plugin_log_service", VERSION_my_plugin_log, &my_plugin_log_handler},
{"mysql_string_service", VERSION_mysql_string, &mysql_string_handler},
{"mysql_malloc_service", VERSION_mysql_malloc, &mysql_malloc_handler},
{"mysql_password_policy_service", VERSION_mysql_password_policy,
{"mysql_parser_service", VERSION_parser, &parser_handler},
{"rpl_transaction_ctx_service", VERSION_rpl_transaction_ctx_service,
{"transaction_write_set_service", VERSION_transaction_write_set_service,
{"security_context_service", VERSION_security_context_service,
{"mysql_locking_service", VERSION_locking_service,
{"mysql_keyring_service", VERSION_mysql_keyring_service,
{"plugin_registry_service", VERSION_plugin_registry_service,
}
#define VERSION_mysql_malloc
Definition: service_versions.h:40
#define VERSION_my_plugin_log
Definition: service_versions.h:38
#define VERSION_locking_service
Definition: service_versions.h:46
#define VERSION_mysql_keyring_service
Definition: service_versions.h:49
#define VERSION_security_context_service
Definition: service_versions.h:45
#define VERSION_thd_alloc
Definition: service_versions.h:35
#define VERSION_my_thread_scheduler
Definition: service_versions.h:37
#define VERSION_rpl_transaction_ctx_service
Definition: service_versions.h:43
#define VERSION_transaction_write_set_service
Definition: service_versions.h:44
#define VERSION_plugin_registry_service
Definition: service_versions.h:50
#define VERSION_thd_wait
Definition: service_versions.h:36
#define VERSION_mysql_password_policy
Definition: service_versions.h:41
#define VERSION_srv_session_service
Definition: service_versions.h:48
#define VERSION_mysql_string
Definition: service_versions.h:39
#define VERSION_srv_session_info_service
Definition: service_versions.h:47
#define VERSION_command
Definition: service_versions.h:34
#define VERSION_parser
Definition: service_versions.h:42
static struct mysql_parser_service_st parser_handler
Definition: sql_plugin_services.h:274
static struct mysql_locking_service_st locking_service_handler
Definition: sql_plugin_services.h:292
static struct mysql_password_policy_service_st mysql_password_policy_handler
Definition: sql_plugin_services.h:271
static struct my_thread_scheduler_service my_thread_scheduler_handler
Definition: sql_plugin_services.h:254
static struct plugin_registry_service_st plugin_registry_handler
Definition: sql_plugin_services.h:304
static struct srv_session_info_service_st srv_session_info_handler
Definition: sql_plugin_services.h:240
static struct thd_alloc_service_st thd_alloc_handler
Definition: sql_plugin_services.h:247
static struct srv_session_service_st srv_session_service_handler
Definition: sql_plugin_services.h:230
static struct thd_wait_service_st thd_wait_handler
Definition: sql_plugin_services.h:251
static struct mysql_keyring_service_st mysql_keyring_handler
Definition: sql_plugin_services.h:301
static struct mysql_malloc_service_st mysql_malloc_handler
Definition: sql_plugin_services.h:268
static struct mysql_string_service_st mysql_string_handler
Definition: sql_plugin_services.h:260
static struct transaction_write_set_service_st transaction_write_set_handler
Definition: sql_plugin_services.h:288
static struct my_plugin_log_service my_plugin_log_handler
Definition: sql_plugin_services.h:257
static struct security_context_service_st security_context_handler
Definition: sql_plugin_services.h:295
static struct command_service_st command_handler
Definition: sql_plugin_services.h:236
static struct rpl_transaction_ctx_service_st rpl_transaction_ctx_handler
Definition: sql_plugin_services.h:284

◆ locking_service_handler

struct mysql_locking_service_st locking_service_handler
static
Initial value:
= {
int mysql_acquire_locking_service_locks(MYSQL_THD opaque_thd, const char *lock_namespace, const char **lock_names, size_t lock_num, enum enum_locking_service_lock_type lock_type, uint64_t lock_timeout)
int mysql_release_locking_service_locks(MYSQL_THD opaque_thd, const char *lock_namespace)
Definition: locking_service.cc:186

◆ my_plugin_log_handler

struct my_plugin_log_service my_plugin_log_handler
static
Initial value:
= {
int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level, const char *format,...)
Definition: log.cc:2339

◆ my_thread_scheduler_handler

struct my_thread_scheduler_service my_thread_scheduler_handler
static
Initial value:
= {
int my_connection_handler_reset()
Destroys the current connection handler and restores the previous.
Definition: connection_handler_manager.cc:306
int my_connection_handler_set(struct Connection_handler_functions *chf, struct THD_event_functions *tef)
Instantiates Plugin_connection_handler based on the supplied Conection_handler_functions and sets it ...
Definition: connection_handler_manager.cc:289

◆ mysql_keyring_handler

struct mysql_keyring_service_st mysql_keyring_handler
static
Initial value:
= {
int my_key_fetch(const char *, char **, const char *, void **, size_t *)
Iterates over all active keyring plugins and calls the mysql_key_fetch API for the first one found.
Definition: keyring_service.cc:125
int my_key_store(const char *, const char *, const char *, const void *, size_t)
Iterates over all active keyring plugins calls the mysql_key_store API for the first one found.
Definition: keyring_service.cc:141
int my_key_generate(const char *, const char *, const char *, size_t)
Iterates over all active keyring plugins and calls the mysql_key_generate API for the first one found...
Definition: keyring_service.cc:166
int my_key_remove(const char *, const char *)
Iterates over all active keyring plugins and calls the mysql_key_remove API for the first one found.
Definition: keyring_service.cc:154

◆ mysql_malloc_handler

struct mysql_malloc_service_st mysql_malloc_handler
static
Initial value:
= {
void * my_malloc(PSI_memory_key key, size_t size, int flags)
Allocates size bytes of memory.
Definition: my_memory.cc:57
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:81
char * my_strdup(PSI_memory_key key, const char *from, myf_t flags)
Definition: my_malloc.cc:548
void * my_memdup(PSI_memory_key key, const void *from, size_t length, myf_t flags)
Definition: my_malloc.cc:540
void my_claim(const void *ptr, bool claim)
Definition: my_malloc.cc:458
char * my_strndup(PSI_memory_key key, const char *from, size_t length, myf_t flags)
Definition: my_malloc.cc:556
void * my_realloc(PSI_memory_key key, void *ptr, size_t size, myf_t flags)
Definition: my_malloc.cc:449

◆ mysql_password_policy_handler

struct mysql_password_policy_service_st mysql_password_policy_handler
static
Initial value:
= {
int my_calculate_password_strength(const char *, unsigned int)
Invoke the component/plugin to evalue the strength of a password.
Definition: password_policy_service.cc:132
int my_validate_password_policy(const char *, unsigned int)
Invoke the component/plugin to validate the input password.
Definition: password_policy_service.cc:74

◆ mysql_string_handler

struct mysql_string_service_st mysql_string_handler
static
Initial value:
= {
}
mysql_string_handle mysql_string_to_lowercase(mysql_string_handle string_handle)
Definition: string_service.cc:148
int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:138
void mysql_string_iterator_free(mysql_string_iterator_handle)
Definition: string_service.cc:78
void mysql_string_free(mysql_string_handle)
Definition: string_service.cc:68
mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle string_handle)
Definition: string_service.cc:83
int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:128
int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:95
int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:118
int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle, const char *charset_name, char *buffer, unsigned int buffer_size, int *error)
Definition: string_service.cc:52

◆ parser_handler

struct mysql_parser_service_st parser_handler
static
Initial value:
= {
void mysql_parser_join_thread(struct my_thread_handle *thread_handle)
Definition: parser_service.cc:218
int mysql_parser_get_statement_type(MYSQL_THD thd)
Definition: parser_service.cc:284
int mysql_parser_parse(MYSQL_THD thd, const MYSQL_LEX_STRING query, unsigned char is_prepared, sql_condition_handler_function handle_condition, void *condition_handler_state)
Definition: parser_service.cc:233
int mysql_parser_get_statement_digest(MYSQL_THD thd, unsigned char *digest)
Definition: parser_service.cc:310
void mysql_parser_start_thread(MYSQL_THD thd, callback_function fun, void *arg, struct my_thread_handle *thread_handle)
MYSQL_THD mysql_parser_current_session()
Definition: parser_service.cc:139
void mysql_parser_set_current_database(MYSQL_THD thd, const MYSQL_LEX_STRING db)
Definition: parser_service.cc:222
int mysql_parser_visit_tree(MYSQL_THD thd, parse_node_visit_function processor, unsigned char *arg)
Definition: parser_service.cc:332
MYSQL_THD mysql_parser_open_session()
Definition: parser_service.cc:141
MYSQL_LEX_STRING mysql_parser_item_string(MYSQL_ITEM item)
Definition: parser_service.cc:338
int mysql_parser_extract_prepared_params(MYSQL_THD thd, int *positions)
Definition: parser_service.cc:324
int mysql_parser_get_number_params(MYSQL_THD thd)
Definition: parser_service.cc:320
MYSQL_LEX_STRING mysql_parser_get_normalized_query(MYSQL_THD thd)
Definition: parser_service.cc:358
MYSQL_LEX_STRING mysql_parser_get_query(MYSQL_THD thd)
Definition: parser_service.cc:352
void mysql_parser_free_string(MYSQL_LEX_STRING string)
Definition: parser_service.cc:350

◆ plugin_registry_handler

struct plugin_registry_service_st plugin_registry_handler
static
Initial value:
= {
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

◆ rpl_transaction_ctx_handler

struct rpl_transaction_ctx_service_st rpl_transaction_ctx_handler
static
Initial value:
= {
}
int set_transaction_ctx(Transaction_termination_ctx transaction_termination_ctx)
Definition: rpl_transaction_ctx.cc:96

◆ security_context_handler

struct security_context_service_st security_context_handler
static
Initial value:
= {
my_svc_bool thd_get_security_context(MYSQL_THD, MYSQL_SECURITY_CONTEXT *out_ctx)
Gets the security context for the thread.
Definition: service_security_context.cc:55
my_svc_bool security_context_set_option(MYSQL_SECURITY_CONTEXT, const char *name, void *pvalue)
Sets a value for a named security context attribute Currently defined names are:
Definition: service_security_context.cc:304
my_svc_bool security_context_lookup(MYSQL_SECURITY_CONTEXT ctx, const char *user, const char *host, const char *ip, const char *db)
Looks up in the defined user accounts an account based on the user@host[ip] combo supplied and checks...
Definition: service_security_context.cc:177
my_svc_bool security_context_create(MYSQL_SECURITY_CONTEXT *out_ctx)
Creates a new security context and initializes it with the defaults (no access, no user etc).
Definition: service_security_context.cc:109
my_svc_bool security_context_get_option(MYSQL_SECURITY_CONTEXT, const char *name, void *inout_pvalue)
Reads a named security context attribute and returns its value.
Definition: service_security_context.cc:239
my_svc_bool security_context_copy(MYSQL_SECURITY_CONTEXT in_ctx, MYSQL_SECURITY_CONTEXT *out_ctx)
Duplicates a security context.
Definition: service_security_context.cc:146
my_svc_bool thd_set_security_context(MYSQL_THD, MYSQL_SECURITY_CONTEXT in_ctx)
Sets a new security context for the thread.
Definition: service_security_context.cc:80
my_svc_bool security_context_destroy(MYSQL_SECURITY_CONTEXT ctx)
Deallocates a security context.
Definition: service_security_context.cc:127

◆ srv_session_info_handler

struct srv_session_info_service_st srv_session_info_handler
static
Initial value:
= {
MYSQL_THD srv_session_info_get_thd(MYSQL_SESSION session)
Returns the THD of a session.
uint16_t srv_session_info_get_client_port(MYSQL_SESSION session)
Returns the client port of a session.
unsigned int srv_session_info_thread_count(const void *plugin)
Returns the number opened sessions in thread initialized by srv_session service.
Definition: srv_session_info_service.cc:144
int srv_session_info_killed(MYSQL_SESSION session)
Returns whether the session was killed.
unsigned int srv_session_info_session_count()
Returns the number opened sessions in thread initialized by srv_session service.
Definition: srv_session_info_service.cc:133
int srv_session_info_set_client_port(MYSQL_SESSION session, uint16_t port)
Sets the client port of a session.
LEX_CSTRING srv_session_info_get_current_db(MYSQL_SESSION session)
Returns the current database of a session.
int srv_session_info_set_connection_type(MYSQL_SESSION session, enum enum_vio_type type)
Sets the connection type of a session.
my_thread_id srv_session_info_get_session_id(MYSQL_SESSION session)
Returns the ID of a session.

◆ srv_session_service_handler

struct srv_session_service_st srv_session_service_handler
static
Initial value:
= {
int srv_session_init_thread(const void *plugin)
Initializes the current physical thread to use with session service.
Definition: srv_session_service.cc:60
int srv_session_attach(MYSQL_SESSION session, MYSQL_THD *ret_previous_thd)
Attaches a session to current physical thread.
Definition: srv_session_service.cc:233
void srv_session_deinit_thread()
Deinitializes the current physical thread to use with session service.
Definition: srv_session_service.cc:67
int srv_session_server_is_available()
Returns if the server is available (not booting or shutting down)
Definition: srv_session_service.cc:222
int srv_session_close(MYSQL_SESSION session)
Closes a previously opened session.
MYSQL_SESSION srv_session_open(srv_session_error_cb error_cb, void *plugin_ctx)
Opens a server session.
Definition: srv_session_service.cc:146
int srv_session_detach(MYSQL_SESSION session)
Detaches a session from current physical thread.

◆ thd_alloc_handler

struct thd_alloc_service_st thd_alloc_handler
static
Initial value:
= {
char * thd_strdup(MYSQL_THD thd, const char *str)
Definition: sql_thd_api.cc:633
void * thd_calloc(MYSQL_THD thd, size_t size)
Definition: sql_thd_api.cc:631
MYSQL_LEX_STRING * thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str, const char *str, size_t size, int allocate_lex_string)
Create a LEX_STRING in this connection's local memory pool.
Definition: sql_thd_api.cc:641
char * thd_strmake(MYSQL_THD thd, const char *str, size_t size)
Definition: sql_thd_api.cc:637
void * thd_memdup(MYSQL_THD thd, const void *str, size_t size)
Definition: sql_thd_api.cc:650
void * thd_alloc(MYSQL_THD thd, size_t size)
Allocate memory in the connection's local memory pool.
Definition: sql_thd_api.cc:629

◆ thd_wait_handler

struct thd_wait_service_st thd_wait_handler
static
Initial value:
void thd_wait_end(THD *thd)
void thd_wait_begin(THD *thd, int wait_type)

◆ transaction_write_set_handler

struct transaction_write_set_service_st transaction_write_set_handler
static
Initial value:
= {
void update_write_set_memory_size_limit(uint64 size_limit)
Definition: rpl_transaction_write_set_ctx.cc:173
void require_full_write_set(bool requires_ws)
Definition: rpl_transaction_write_set_ctx.cc:153
Transaction_write_set * get_transaction_write_set(unsigned long m_thread_id)
Definition: rpl_transaction_write_set_ctx.cc:193
void set_write_set_memory_size_limit(uint64 size_limit)
Definition: rpl_transaction_write_set_ctx.cc:168