MySQL 9.1.0
Source Code Documentation
|
#include <mysql/plugin.h>
#include <mysql/plugin_audit.h>
#include <mysqld_error.h>
#include <stdio.h>
#include <sys/types.h>
#include "lex_string.h"
#include "m_string.h"
#include "my_compiler.h"
#include "my_inttypes.h"
#include "my_macros.h"
#include "my_sys.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysql/strings/m_ctype.h"
#include "nulls.h"
#include "string_with_len.h"
#include "strxnmov.h"
#include "thr_mutex.h"
#include "plugin/audit_null/audit_null_variables.h"
Macros | |
#define | AUDIT_NULL_VAR(x) static volatile int number_of_calls_##x; |
#define | AUDIT_NULL_VAR(x) |
Functions | |
static void | increment_counter (volatile int *counter) |
static | MYSQL_THDVAR_STR (abort_message, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Custom message for event abort.", nullptr, nullptr, nullptr) |
static | MYSQL_THDVAR_INT (abort_value, PLUGIN_VAR_RQCMDARG, "Event abort value.", nullptr, nullptr, 1, -1, 150, 0) |
static | MYSQL_THDVAR_STR (event_order_check, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Event order check string", nullptr, nullptr, nullptr) |
static | MYSQL_THDVAR_UINT (event_order_check_consume_ignore_count, PLUGIN_VAR_RQCMDARG, "Do not consume event order string specified " "number of times.", nullptr, nullptr, 0, 0, UINT_MAX, 1) |
static | MYSQL_THDVAR_INT (event_order_started, PLUGIN_VAR_RQCMDARG, "Plugin is in the event order check.", nullptr, nullptr, 0, 0, 1, 0) |
static | MYSQL_THDVAR_INT (event_order_check_exact, PLUGIN_VAR_RQCMDARG, "Plugin checks exact event order.", nullptr, nullptr, 1, 0, 1, 0) |
static | MYSQL_THDVAR_STR (event_record_def, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Event recording definition", nullptr, nullptr, nullptr) |
static | MYSQL_THDVAR_STR (event_record, PLUGIN_VAR_READONLY|PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Event recording", nullptr, nullptr, nullptr) |
static int | audit_null_plugin_init (void *arg) |
static int | audit_null_plugin_deinit (void *arg) |
static LEX_CSTRING | event_to_str (unsigned int event_class, unsigned long event_subclass) |
Converts event_class and event_subclass into a string. More... | |
static LEX_CSTRING | get_token (char **str) |
Read token delimited by a semicolon from a string. More... | |
static char * | add_event (const char *var, LEX_CSTRING event, const char *data, size_t data_length) |
static void | process_event_record (MYSQL_THD thd, LEX_CSTRING event_name, const char *data, size_t data_length) |
static int | process_command (MYSQL_THD thd, LEX_CSTRING event_command, bool consume_event) |
static size_t | get_snprintf_len (int snprintf_res, size_t buffer_size) |
Helper function that returns the actual length of the string composed by snprintf(). More... | |
static int | audit_null_notify (MYSQL_THD thd, mysql_event_class_t event_class, const void *event) |
Plugin function handler. More... | |
mysql_declare_plugin (audit_null) | |
Variables | |
LEX_CSTRING | event_names [][6] |
Event strings. More... | |
static volatile int | number_of_calls |
static bool | g_plugin_installed = false |
static mysql_mutex_t | g_record_buffer_mutex |
static char * | g_record_buffer |
static SHOW_VAR | simple_status [] |
static struct st_mysql_audit | audit_null_descriptor |
static SYS_VAR * | system_variables [] |
mysql_declare_plugin_end | |
#define AUDIT_NULL_VAR | ( | x | ) | static volatile int number_of_calls_##x; |
#define AUDIT_NULL_VAR | ( | x | ) |
|
static |
|
static |
Plugin function handler.
[in] | thd | Connection context. |
[in] | event_class | Event class value. |
[in] | event | Event data. |
Value | indicating, whether the server should abort continuation of the current operation. |
|
static |
|
static |
|
static |
Converts event_class and event_subclass into a string.
[in] | event_class | Event class value. |
[in] | event_subclass | Event subclass value. |
Event | name. |
|
inlinestatic |
Helper function that returns the actual length of the string composed by snprintf().
Normally snprintf() returns length of the result string, but on error it returns negative value. When the buffer is too small, the return value of snprintf() will be > buffer_size while the result string will be turncated to buffer_size - 1.
snprintf_res | value returned by snprintf |
buffer_size | size of buffer possed to snprintf |
|
static |
Read token delimited by a semicolon from a string.
[in,out] | str | Pointer to a string containing text. Pointer is moved to a new token after the function ends. |
Token | retrieved from a string. |
|
static |
mysql_declare_plugin | ( | audit_null | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
LEX_CSTRING event_names[][6] |
Event strings.
|
static |
|
static |
|
static |
mysql_declare_plugin_end |
|
static |
|
static |
|
static |