MySQL  8.0.18
Source Code Documentation
test_x_sessions_init.cc File Reference
#include <fcntl.h>
#include <mysql/plugin.h>
#include <stdlib.h>
#include <sys/types.h>
#include <mysql/components/my_service.h>
#include <mysql/components/services/log_builtins.h>
#include <mysqld_error.h>
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_sys.h"
#include "template_utils.h"

Classes

struct  st_plugin_ctx
 
struct  test_thread_context
 

Macros

#define LOG_COMPONENT_TAG   "test_x_sessions_init"
 
#define MAX_SESSIONS   128
 
#define STRING_BUFFER_SIZE   512
 
#define WRITE_STR(format)
 
#define WRITE_VAL(format, value)
 
#define WRITE_SEP()   my_write(outfile, pointer_cast<const uchar *>(sep), strlen(sep), MYF(0))
 

Functions

static MYSQL_SYSVAR_INT (nb_sessions, nb_sessions, PLUGIN_VAR_RQCMDARG, "number of sessions", NULL, NULL, 1, 1, 500, 0)
 
static void test_session (void *p)
 
static void test_session_non_reverse (void *p)
 
static void test_session_only_open (void *p)
 
static void * test_sql_threaded_wrapper (void *param)
 
static void create_log_file (const char *log_name)
 
static void test_in_spawned_thread (void *p, void(*test_function)(void *))
 
static int test_session_service_plugin_init (void *p)
 
static int test_session_service_plugin_deinit (void *p)
 
 mysql_declare_plugin (test_daemon)
 

Variables

static const char * log_filename = "test_x_sessions_init"
 
static const char * sep
 
int nb_sessions
 
static SYS_VARtest_services_sysvars [] = {MYSQL_SYSVAR(nb_sessions), NULL}
 
const struct st_command_service_cbs sql_cbs
 
static const mysql_service_registry_treg_srv = nullptr
 
const mysql_service_log_builtins_tlog_bi = nullptr
 accessor built-ins More...
 
const mysql_service_log_builtins_string_tlog_bs = nullptr
 string built-ins More...
 
static File outfile
 
struct st_mysql_daemon test_session_service_plugin
 
 mysql_declare_plugin_end
 

Macro Definition Documentation

◆ LOG_COMPONENT_TAG

#define LOG_COMPONENT_TAG   "test_x_sessions_init"

◆ MAX_SESSIONS

#define MAX_SESSIONS   128

◆ STRING_BUFFER_SIZE

#define STRING_BUFFER_SIZE   512

◆ WRITE_SEP

#define WRITE_SEP ( )    my_write(outfile, pointer_cast<const uchar *>(sep), strlen(sep), MYF(0))

◆ WRITE_STR

#define WRITE_STR (   format)
Value:
snprintf(buffer, sizeof(buffer), "%s", format); \
my_write(outfile, (uchar *)buffer, strlen(buffer), MYF(0))
unsigned char uchar
Definition: my_inttypes.h:51
char buffer[STRING_BUFFER]
Definition: test_sql_9_sessions.cc:57
static File outfile
Definition: test_x_sessions_init.cc:110
#define MYF(v)
Definition: my_inttypes.h:114

◆ WRITE_VAL

#define WRITE_VAL (   format,
  value 
)
Value:
snprintf(buffer, sizeof(buffer), format, value); \
my_write(outfile, (uchar *)buffer, strlen(buffer), MYF(0))
unsigned char uchar
Definition: my_inttypes.h:51
char buffer[STRING_BUFFER]
Definition: test_sql_9_sessions.cc:57
static File outfile
Definition: test_x_sessions_init.cc:110
#define MYF(v)
Definition: my_inttypes.h:114
const string value("\alue\)

Function Documentation

◆ create_log_file()

static void create_log_file ( const char *  log_name)
static

◆ mysql_declare_plugin()

mysql_declare_plugin ( test_daemon  )

◆ MYSQL_SYSVAR_INT()

static MYSQL_SYSVAR_INT ( nb_sessions  ,
nb_sessions  ,
PLUGIN_VAR_RQCMDARG  ,
"number of sessions"  ,
NULL  ,
NULL  ,
,
,
500  ,
 
)
static

◆ test_in_spawned_thread()

static void test_in_spawned_thread ( void *  p,
void(*)(void *)  test_function 
)
static

◆ test_session()

static void test_session ( void *  p)
static

◆ test_session_non_reverse()

static void test_session_non_reverse ( void *  p)
static

◆ test_session_only_open()

static void test_session_only_open ( void *  p)
static

◆ test_session_service_plugin_deinit()

static int test_session_service_plugin_deinit ( void *  p)
static

◆ test_session_service_plugin_init()

static int test_session_service_plugin_init ( void *  p)
static

◆ test_sql_threaded_wrapper()

static void* test_sql_threaded_wrapper ( void *  param)
static

Variable Documentation

◆ log_bi

const mysql_service_log_builtins_t* log_bi = nullptr

accessor built-ins

accessor built-ins

◆ log_bs

const mysql_service_log_builtins_string_t* log_bs = nullptr

string built-ins

◆ log_filename

const char* log_filename = "test_x_sessions_init"
static

◆ mysql_declare_plugin_end

mysql_declare_plugin_end

◆ nb_sessions

int nb_sessions

◆ outfile

File outfile
static

◆ reg_srv

const mysql_service_registry_t* reg_srv = nullptr
static

◆ sep

const char* sep
static
Initial value:
=
"========================================================================"
"\n"

◆ sql_cbs

const struct st_command_service_cbs sql_cbs
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
#define NULL
Definition: types.h:55

◆ test_services_sysvars

SYS_VAR* test_services_sysvars[] = {MYSQL_SYSVAR(nb_sessions), NULL}
static

◆ test_session_service_plugin

struct st_mysql_daemon test_session_service_plugin
Initial value:
= {
#define MYSQL_DAEMON_INTERFACE_VERSION
Definition: plugin.h:673