MySQL  8.0.21
Source Code Documentation
test_security_context.cc File Reference
#include <mysql/plugin.h>
#include <mysql/plugin_audit.h>
#include <mysql/service_my_plugin_log.h>
#include <mysql/service_security_context.h>
#include <stdio.h>
#include <string.h>

Functions

static MYSQL_THDVAR_STR (get_field, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Get specified security context field.", nullptr, nullptr, nullptr)
 
static MYSQL_THDVAR_STR (get_value, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Get specified security context field value.", nullptr, nullptr, nullptr)
 
static int test_security_context_notify (MYSQL_THD thd, mysql_event_class_t event_class, const void *event)
 Tests the security context service. More...
 
 mysql_declare_plugin (test_security_context)
 Plugin declaration. More...
 

Variables

static struct st_mysql_audit test_security_context_descriptor
 Plugin descriptor structure. More...
 
static SYS_VARsystem_variables []
 
 mysql_declare_plugin_end
 

Function Documentation

◆ mysql_declare_plugin()

mysql_declare_plugin ( test_security_context  )

Plugin declaration.

◆ MYSQL_THDVAR_STR() [1/2]

static MYSQL_THDVAR_STR ( get_field  ,
PLUGIN_VAR_RQCMDARG PLUGIN_VAR_MEMALLOC,
"Get specified security context field."  ,
nullptr  ,
nullptr  ,
nullptr   
)
static

◆ MYSQL_THDVAR_STR() [2/2]

static MYSQL_THDVAR_STR ( get_value  ,
PLUGIN_VAR_RQCMDARG PLUGIN_VAR_MEMALLOC,
"Get specified security context field value."  ,
nullptr  ,
nullptr  ,
nullptr   
)
static

◆ test_security_context_notify()

static int test_security_context_notify ( MYSQL_THD  thd,
mysql_event_class_t  event_class,
const void *  event 
)
static

Tests the security context service.

Do not run this in multple concurrent threads !

Parameters
thdthe thread to work with
event_classaudit event class
eventevent data

Variable Documentation

◆ mysql_declare_plugin_end

mysql_declare_plugin_end

◆ system_variables

SYS_VAR* system_variables[]
static
Initial value:
= {
MYSQL_SYSVAR(get_field), MYSQL_SYSVAR(get_value), nullptr}
#define MYSQL_SYSVAR(name)
Definition: plugin.h:281
bool get_field(MEM_ROOT *mem, Field *field, String *res)
Allocate string field in MEM_ROOT and return it as String.
Definition: table.cc:3524

◆ test_security_context_descriptor

struct st_mysql_audit test_security_context_descriptor
static
Initial value:
= {
nullptr,
{
0,
0,
0,
0,
0,
0,
0,
0,
(unsigned long)MYSQL_AUDIT_COMMAND_START,
}
}
static int test_security_context_notify(MYSQL_THD thd, mysql_event_class_t event_class, const void *event)
Tests the security context service.
Definition: test_security_context.cc:47
#define MYSQL_AUDIT_INTERFACE_VERSION
Definition: plugin_audit.h:40
Command start event.
Definition: plugin_audit.h:424

Plugin descriptor structure.