MySQL  8.0.18
Source Code Documentation
test_status_var_service.cc File Reference
#include <mysql/components/component_implementation.h>
#include <mysql/components/services/component_status_var_service.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>

Classes

struct  example_vars_t
 

Macros

#define MAX_BUFFER_LENGTH   100
 This file contains a test (example) component, which tests the apis of "status_variable_registration" service provided by the "mysql_server" component. More...
 
#define WRITE_LOG(format, lit_log_text)
 

Functions

 REQUIRES_SERVICE_PLACEHOLDER (status_variable_registration)
 
static void char_ptr_foo ()
 
static int show_func_example (THD *, SHOW_VAR *var, char *buf)
 
static mysql_service_status_t test_component_status_var_service_init ()
 Initialization entry method for test component. More...
 
static mysql_service_status_t test_component_status_var_service_deinit ()
 De-initialization method for Component. More...
 
 END_COMPONENT_PROVIDES ()
 
 REQUIRES_SERVICE (status_variable_registration)
 
 END_COMPONENT_REQUIRES ()
 
 METADATA ("mysql.author", "Oracle Corporation")
 
 METADATA ("mysql.license", "GPL")
 
 METADATA ("test_component_status_var_service", "1")
 
 END_COMPONENT_METADATA ()
 

Variables

int log_text_len = 0
 
char log_text [MAX_BUFFER_LENGTH]
 
FILE * outfile
 
const char * filename = "test_component_status_var_service.log"
 
static int int_variable_value = 7
 
static bool bool_variable_value = true
 
static long long_variable_value = 1234567
 
static double double_variable_value = 8.0
 
static long long longlong_variable_value = 123456789
 
static char char_variable_value [] = "Testing CHAR status variable"
 
static char * char_ptr_variable_value = nullptr
 
static SHOW_VAR status_int_var []
 
static SHOW_VAR status_bool_var []
 
static SHOW_VAR status_long_var []
 
static SHOW_VAR status_longlong_var []
 
static SHOW_VAR status_char_var []
 
static SHOW_VAR status_char_ptr_var []
 
static SHOW_VAR status_double_var []
 
static SHOW_VAR status_func_var []
 
example_vars_t example_vars = {"MySQL", 8.0}
 
static SHOW_VAR array_value []
 
static SHOW_VAR status_array_var []
 
mysql_component_t mysql_component_test_component_status_var_service
 

Macro Definition Documentation

◆ MAX_BUFFER_LENGTH

#define MAX_BUFFER_LENGTH   100

This file contains a test (example) component, which tests the apis of "status_variable_registration" service provided by the "mysql_server" component.

◆ WRITE_LOG

#define WRITE_LOG (   format,
  lit_log_text 
)
Value:
log_text_len = sprintf(log_text, format, lit_log_text); \
fwrite((unsigned char *)log_text, sizeof(char), log_text_len, outfile)
FILE * outfile
Definition: test_status_var_service.cc:39
char log_text[MAX_BUFFER_LENGTH]
Definition: test_status_var_service.cc:38
int log_text_len
Definition: test_status_var_service.cc:37

Function Documentation

◆ char_ptr_foo()

static void char_ptr_foo ( )
static

◆ END_COMPONENT_METADATA()

END_COMPONENT_METADATA ( )

◆ END_COMPONENT_PROVIDES()

END_COMPONENT_PROVIDES ( )

◆ END_COMPONENT_REQUIRES()

END_COMPONENT_REQUIRES ( )

◆ METADATA() [1/3]

METADATA ( "mysql.author"  ,
"Oracle Corporation"   
)

◆ METADATA() [2/3]

METADATA ( "mysql.license"  ,
"GPL"   
)

◆ METADATA() [3/3]

METADATA ( "test_component_status_var_service"  ,
"1"   
)

◆ REQUIRES_SERVICE()

REQUIRES_SERVICE ( status_variable_registration  )

◆ REQUIRES_SERVICE_PLACEHOLDER()

REQUIRES_SERVICE_PLACEHOLDER ( status_variable_registration  )

◆ show_func_example()

static int show_func_example ( THD ,
SHOW_VAR var,
char *  buf 
)
static

◆ test_component_status_var_service_deinit()

static mysql_service_status_t test_component_status_var_service_deinit ( )
static

De-initialization method for Component.

◆ test_component_status_var_service_init()

static mysql_service_status_t test_component_status_var_service_init ( )
static

Initialization entry method for test component.

It executes the tests of the service.

Variable Documentation

◆ array_value

SHOW_VAR array_value[]
static
Initial value:
= {
}
double var2
Definition: test_status_var_service.cc:124
Definition: status_var.h:39
Definition: status_var.h:68
example_vars_t example_vars
Definition: test_status_var_service.cc:126
Definition: status_var.h:35
Definition: status_var.h:30
Definition: status_var.h:69
char var1[10]
Definition: test_status_var_service.cc:123

◆ bool_variable_value

bool bool_variable_value = true
static

◆ char_ptr_variable_value

char* char_ptr_variable_value = nullptr
static

◆ char_variable_value

char char_variable_value[] = "Testing CHAR status variable"
static

◆ double_variable_value

double double_variable_value = 8.0
static

◆ example_vars

example_vars_t example_vars = {"MySQL", 8.0}

◆ filename

const char* filename = "test_component_status_var_service.log"

◆ int_variable_value

int int_variable_value = 7
static

◆ log_text

char log_text[MAX_BUFFER_LENGTH]

◆ log_text_len

int log_text_len = 0

◆ long_variable_value

long long_variable_value = 1234567
static

◆ longlong_variable_value

long long longlong_variable_value = 123456789
static

◆ mysql_component_test_component_status_var_service

mysql_component_t mysql_component_test_component_status_var_service
Initial value:
= { "mysql:test_component_status_var_service" , __test_component_status_var_service_provides, __test_component_status_var_service_requires, __test_component_status_var_service_metadata,
static mysql_service_status_t test_component_status_var_service_deinit()
De-initialization method for Component.
Definition: test_status_var_service.cc:194
static mysql_service_status_t test_component_status_var_service_init()
Initialization entry method for test component.
Definition: test_status_var_service.cc:142

◆ outfile

FILE* outfile

◆ status_array_var

SHOW_VAR status_array_var[]
static
Initial value:
= {
{"test_component.array", (char *)array_value, SHOW_ARRAY,
}
Definition: status_var.h:37
Definition: status_var.h:68
Definition: status_var.h:30
static SHOW_VAR array_value[]
Definition: test_status_var_service.cc:127
Definition: status_var.h:69

◆ status_bool_var

SHOW_VAR status_bool_var[]
static
Initial value:
= {
{"test_component.bool_var", (char *)&bool_variable_value, SHOW_BOOL,
}
Definition: status_var.h:68
Definition: status_var.h:30
Definition: status_var.h:31
Definition: status_var.h:69
static bool bool_variable_value
Definition: test_status_var_service.cc:50

◆ status_char_ptr_var

SHOW_VAR status_char_ptr_var[]
static
Initial value:
= {
{"test_component.char_ptr_var", (char *)&char_ptr_variable_value,
}
Definition: status_var.h:68
Definition: status_var.h:36
Definition: status_var.h:30
static char * char_ptr_variable_value
Definition: test_status_var_service.cc:55
Definition: status_var.h:69

◆ status_char_var

SHOW_VAR status_char_var[]
static
Initial value:
= {
{"test_component.char_var", (char *)&char_variable_value, SHOW_CHAR,
}
Definition: status_var.h:68
Definition: status_var.h:35
Definition: status_var.h:30
static char char_variable_value[]
Definition: test_status_var_service.cc:54
Definition: status_var.h:69

◆ status_double_var

SHOW_VAR status_double_var[]
static
Initial value:
= {
{"test_component.double_var", (char *)&double_variable_value, SHOW_DOUBLE,
}
Definition: status_var.h:39
Definition: status_var.h:68
Definition: status_var.h:30
Definition: status_var.h:69
static double double_variable_value
Definition: test_status_var_service.cc:52

◆ status_func_var

SHOW_VAR status_func_var[]
static
Initial value:
= {
{"test_component.func_var", (char *)show_func_example, SHOW_FUNC,
}
Definition: status_var.h:68
Definition: status_var.h:38
Definition: status_var.h:30
static int show_func_example(THD *, SHOW_VAR *var, char *buf)
Definition: test_status_var_service.cc:110
Definition: status_var.h:69

◆ status_int_var

SHOW_VAR status_int_var[]
static
Initial value:
= {
{"test_component.int_var", (char *)&int_variable_value, SHOW_INT,
}
static int int_variable_value
Definition: test_status_var_service.cc:49
shown as unsigned int
Definition: status_var.h:32
Definition: status_var.h:68
Definition: status_var.h:30
Definition: status_var.h:69

◆ status_long_var

SHOW_VAR status_long_var[]
static
Initial value:
= {
{"test_component.long_var", (char *)&long_variable_value, SHOW_LONG,
}
shown as unsigned long
Definition: status_var.h:33
Definition: status_var.h:68
Definition: status_var.h:30
Definition: status_var.h:69
static long long_variable_value
Definition: test_status_var_service.cc:51

◆ status_longlong_var

SHOW_VAR status_longlong_var[]
static
Initial value:
= {
{"test_component.longlong_var", (char *)&longlong_variable_value,
}
static long long longlong_variable_value
Definition: test_status_var_service.cc:53
Definition: status_var.h:68
Definition: status_var.h:30
Definition: status_var.h:69
shown as unsigned longlong
Definition: status_var.h:34