MySQL 8.4.3
Source Code Documentation
|
#include <stddef.h>
#include <sys/types.h>
#include <vector>
#include "lex_string.h"
#include "my_io.h"
#include "my_sqlcommand.h"
#include "mysql/components/services/bits/mysql_mutex_bits.h"
#include "sql/sql_cmd.h"
#include "sql/sql_plugin_ref.h"
Go to the source code of this file.
Classes | |
struct | st_plugin_dl |
class | Sql_cmd_install_plugin |
This class implements the INSTALL PLUGIN statement. More... | |
class | Sql_cmd_uninstall_plugin |
This class implements the UNINSTALL PLUGIN statement. More... | |
Namespaces | |
namespace | dd |
The version of the current data dictionary table definitions. | |
namespace | dd::upgrade |
Macros | |
#define | plugin_ref_to_int(A) (A ? A[0] : NULL) |
#define | plugin_int_to_ref(A) &(A) |
#define | PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1 |
#define | PLUGIN_INIT_SKIP_PLUGIN_TABLE 2 |
#define | PLUGIN_INIT_SKIP_INITIALIZATION 4 |
#define | PLUGIN_INIT_DELAY_UNTIL_AFTER_UPGRADE 8 |
#define | MYSQL_ANY_PLUGIN -1 |
#define | PLUGIN_IS_FREED 1 |
#define | PLUGIN_IS_DELETED 2 |
#define | PLUGIN_IS_UNINITIALIZED 4 |
#define | PLUGIN_IS_READY 8 |
#define | PLUGIN_IS_DYING 16 |
#define | PLUGIN_IS_DISABLED 32 |
#define | PLUGIN_IS_WAITING_FOR_UPGRADE 64 |
#define | my_plugin_lock_by_name(A, B, C) plugin_lock_by_name(A, B, C) |
#define | my_plugin_lock_by_name_ci(A, B, C) plugin_lock_by_name(A, B, C) |
#define | my_plugin_lock(A, B) plugin_lock(A, B) |
#define | my_plugin_lock_ci(A, B) plugin_lock(A, B) |
#define | plugin_foreach(A, B, C, D) plugin_foreach_with_mask(A, B, C, PLUGIN_IS_READY, D) |
Typedefs | |
typedef int(* | plugin_type_init) (struct st_plugin_int *) |
typedef bool() | plugin_foreach_func(THD *thd, plugin_ref plugin, void *arg) |
Functions | |
bool | plugin_register_early_plugins (int *argc, char **argv, int flags) |
Register and initialize early plugins. More... | |
bool | plugin_register_builtin_and_init_core_se (int *argc, char **argv) |
Register the builtin plugins. More... | |
bool | plugin_register_dynamic_and_init_all (int *argc, char **argv, int init_flags) |
Register and initialize the dynamic plugins. More... | |
bool | update_persisted_plugin_sysvars (const char *name) |
Update read-write persisted plugin system variables. More... | |
bool | dd::upgrade::plugin_initialize_delayed_after_upgrade () |
Initialize delayed plugins. More... | |
bool | is_builtin_and_core_se_initialized () |
void | plugin_shutdown (void) |
void | add_plugin_options (std::vector< my_option > *options, MEM_ROOT *mem_root) |
bool | plugin_is_ready (const LEX_CSTRING &name, int type) |
plugin_ref | plugin_lock (THD *thd, plugin_ref *ptr) |
plugin_ref | plugin_lock_by_name (THD *thd, const LEX_CSTRING &name, int type) |
void | plugin_unlock (THD *thd, plugin_ref plugin) |
void | plugin_unlock_list (THD *thd, plugin_ref *list, size_t count) |
void | plugin_thdvar_init (THD *thd, bool enable_plugins) |
void | plugin_thdvar_cleanup (THD *thd, bool enable_plugins) |
void | plugin_thdvar_safe_update (THD *thd, SYS_VAR *var, char **dest, const char *value) |
Set value for a thread local variable. More... | |
bool | check_valid_path (const char *path, size_t length) |
Check if the provided path is valid in the sense that it does cause a relative reference outside the directory. More... | |
void | alloc_and_copy_thd_dynamic_variables (THD *thd, bool global_lock) |
Allocate memory and copy dynamic variables from global system variables to per-thread system variables copy. More... | |
bool | plugin_foreach_with_mask (THD *thd, plugin_foreach_func *func, int type, uint state_mask, void *arg) |
bool | plugin_foreach_with_mask (THD *thd, plugin_foreach_func **funcs, int type, uint state_mask, void *arg) |
bool | end_transaction (THD *thd, bool error) |
bool | plugin_early_load_one (int *argc, char **argv, const char *plugin) |
Initialize one plugin. More... | |
Variables | |
const char * | global_plugin_typelib_names [] |
mysql_mutex_t | LOCK_plugin |
Serializes access to the global plugin memory list. More... | |
mysql_mutex_t | LOCK_plugin_delete |
I_List< i_string > * | opt_plugin_load_list_ptr |
I_List< i_string > * | opt_early_plugin_load_list_ptr |
char * | opt_plugin_dir_ptr |
char | opt_plugin_dir [FN_REFLEN] |
const LEX_CSTRING | plugin_type_names [] |
#define my_plugin_lock | ( | A, | |
B | |||
) | plugin_lock(A, B) |
#define my_plugin_lock_by_name | ( | A, | |
B, | |||
C | |||
) | plugin_lock_by_name(A, B, C) |
#define my_plugin_lock_by_name_ci | ( | A, | |
B, | |||
C | |||
) | plugin_lock_by_name(A, B, C) |
#define my_plugin_lock_ci | ( | A, | |
B | |||
) | plugin_lock(A, B) |
#define MYSQL_ANY_PLUGIN -1 |
#define plugin_foreach | ( | A, | |
B, | |||
C, | |||
D | |||
) | plugin_foreach_with_mask(A, B, C, PLUGIN_IS_READY, D) |
#define PLUGIN_INIT_DELAY_UNTIL_AFTER_UPGRADE 8 |
#define PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1 |
#define PLUGIN_INIT_SKIP_INITIALIZATION 4 |
#define PLUGIN_INIT_SKIP_PLUGIN_TABLE 2 |
#define plugin_int_to_ref | ( | A | ) | &(A) |
#define PLUGIN_IS_DELETED 2 |
#define PLUGIN_IS_DISABLED 32 |
#define PLUGIN_IS_DYING 16 |
#define PLUGIN_IS_FREED 1 |
#define PLUGIN_IS_READY 8 |
#define PLUGIN_IS_UNINITIALIZED 4 |
#define PLUGIN_IS_WAITING_FOR_UPGRADE 64 |
#define plugin_ref_to_int | ( | A | ) | (A ? A[0] : NULL) |
typedef bool() plugin_foreach_func(THD *thd, plugin_ref plugin, void *arg) |
typedef int(* plugin_type_init) (struct st_plugin_int *) |
void alloc_and_copy_thd_dynamic_variables | ( | THD * | thd, |
bool | global_lock | ||
) |
Allocate memory and copy dynamic variables from global system variables to per-thread system variables copy.
thd | thread context |
global_lock | If true LOCK_global_system_variables should be acquired while copying variables from global variables copy. |
bool check_valid_path | ( | const char * | path, |
size_t | len | ||
) |
Check if the provided path is valid in the sense that it does cause a relative reference outside the directory.
bool end_transaction | ( | THD * | thd, |
bool | error | ||
) |
bool is_builtin_and_core_se_initialized | ( | ) |
bool plugin_early_load_one | ( | int * | argc, |
char ** | argv, | ||
const char * | plugin | ||
) |
Initialize one plugin.
This function is used to early load one single plugin. This function is used by key migration tool.
[in] | argc | Command line argument counter |
[in] | argv | Command line arguments |
[in] | plugin | library file name |
0 | OK |
1 | ERROR |
bool plugin_foreach_with_mask | ( | THD * | thd, |
plugin_foreach_func ** | funcs, | ||
int | type, | ||
uint | state_mask, | ||
void * | arg | ||
) |
bool plugin_foreach_with_mask | ( | THD * | thd, |
plugin_foreach_func * | func, | ||
int | type, | ||
uint | state_mask, | ||
void * | arg | ||
) |
bool plugin_is_ready | ( | const LEX_CSTRING & | name, |
int | type | ||
) |
plugin_ref plugin_lock | ( | THD * | thd, |
plugin_ref * | ptr | ||
) |
plugin_ref plugin_lock_by_name | ( | THD * | thd, |
const LEX_CSTRING & | name, | ||
int | type | ||
) |
bool plugin_register_builtin_and_init_core_se | ( | int * | argc, |
char ** | argv | ||
) |
Register the builtin plugins.
Some of the plugins (MyISAM, CSV and InnoDB) are also initialized.
argc | number of arguments, propagated to the plugin |
argv | actual arguments, propagated to the plugin |
bool plugin_register_dynamic_and_init_all | ( | int * | argc, |
char ** | argv, | ||
int | flags | ||
) |
Register and initialize the dynamic plugins.
Also initialize the remaining builtin plugins that are not initialized already.
argc | Command line argument counter |
argv | Command line arguments |
flags | Flags to control whether dynamic loading and plugin initialization should be skipped |
bool plugin_register_early_plugins | ( | int * | argc, |
char ** | argv, | ||
int | flags | ||
) |
Register and initialize early plugins.
argc | Command line argument counter |
argv | Command line arguments |
flags | Flags to control whether dynamic loading and plugin initialization should be skipped |
void plugin_shutdown | ( | void | ) |
void plugin_thdvar_cleanup | ( | THD * | thd, |
bool | enable_plugins | ||
) |
void plugin_thdvar_init | ( | THD * | thd, |
bool | enable_plugins | ||
) |
Set value for a thread local variable.
[in] | thd | Thread context. |
[in] | var | Plugin variable. |
[in,out] | dest | Destination memory pointer. |
[in] | value | New value. |
Note: new value should be '\0'-terminated for string variables.
Used in plugin.h:THDVAR_SET(thd, name, value) macro.
void plugin_unlock | ( | THD * | thd, |
plugin_ref | plugin | ||
) |
void plugin_unlock_list | ( | THD * | thd, |
plugin_ref * | list, | ||
size_t | count | ||
) |
bool update_persisted_plugin_sysvars | ( | const char * | name | ) |
Update read-write persisted plugin system variables.
name | plugin name |
|
extern |
|
extern |
Serializes access to the global plugin memory list.
LOCK_plugin must be acquired before accessing plugin_dl_array, plugin_array and plugin_hash. We are always manipulating ref count, so a rwlock here is unnecessary. If it must be taken together with the LOCK_system_variables_hash then LOCK_plugin must be taken after LOCK_system_variables_hash.
|
extern |
|
extern |
|
extern |
|
extern |