MySQL  8.0.18
Source Code Documentation
pfs_example_component_population.cc File Reference
#include "pfs_example_component_population.h"
#include <cstring>
#include "my_sys.h"
#include "pfs_example_continent.h"
#include "pfs_example_country.h"

Macros

#define MAX_BUFFER_LENGTH   80
 
#define WRITE_LOG(lit_log_text)
 

Functions

int continent_prepare_insert_row ()
 
int country_prepare_insert_row ()
 
mysql_service_status_t pfs_example_component_population_init ()
 Initialize the pfs_example_component_population at server start or component installation. More...
 
mysql_service_status_t pfs_example_component_population_deinit ()
 Terminate the pfs_example_component_population at server shutdown or component deinstallation. More...
 
 END_COMPONENT_PROVIDES ()
 
 REQUIRES_SERVICE_PLACEHOLDER (pfs_plugin_table)
 
 REQUIRES_SERVICE (pfs_plugin_table)
 
 END_COMPONENT_REQUIRES ()
 
 METADATA ("mysql.author", "Oracle Corporation")
 
 METADATA ("mysql.license", "GPL")
 
 METADATA ("test_property", "1")
 
 END_COMPONENT_METADATA ()
 

Variables

Continent_record continent_array []
 
Country_record country_array []
 
FILE * outfile = NULL
 
const char * filename = "pfs_example_component_population.log"
 
char log_text [MAX_BUFFER_LENGTH] = {'\0'}
 
PFS_engine_table_share_proxyshare_list [2] = {NULL, NULL}
 
unsigned int share_list_count = 2
 
mysql_component_t mysql_component_pfs_example_component_population
 

Macro Definition Documentation

◆ MAX_BUFFER_LENGTH

#define MAX_BUFFER_LENGTH   80

◆ WRITE_LOG

#define WRITE_LOG (   lit_log_text)
Value:
if (outfile) { \
strcpy(log_text, lit_log_text); \
fwrite((uchar *)log_text, sizeof(char), strlen(log_text), outfile); \
}
unsigned char uchar
Definition: my_inttypes.h:51
FILE * outfile
Definition: pfs_example_component_population.cc:63
char log_text[MAX_BUFFER_LENGTH]
Definition: pfs_example_component_population.cc:65

Function Documentation

◆ continent_prepare_insert_row()

int continent_prepare_insert_row ( )

◆ country_prepare_insert_row()

int country_prepare_insert_row ( )

◆ 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_property"  ,
"1"   
)

◆ pfs_example_component_population_deinit()

mysql_service_status_t pfs_example_component_population_deinit ( )

Terminate the pfs_example_component_population at server shutdown or component deinstallation.

  • Delete/Drop component tables from Performance Schema.
Return values
0success
non-zerofailure

Call delete_tables function of pfs_plugin_table service to delete component tables from performance schema

◆ pfs_example_component_population_init()

mysql_service_status_t pfs_example_component_population_init ( )

Initialize the pfs_example_component_population at server start or component installation.

  • Instantiate and initialize PFS_engine_table_share_proxy.
  • Prepare and insert rows in tables from here.
  • Call add_table method of pfs_plugin_table service.
Return values
0success
non-zerofailure

Call add_table function of pfs_plugin_table service to add component tables in performance schema.

◆ REQUIRES_SERVICE()

REQUIRES_SERVICE ( pfs_plugin_table  )

◆ REQUIRES_SERVICE_PLACEHOLDER()

REQUIRES_SERVICE_PLACEHOLDER ( pfs_plugin_table  )

Variable Documentation

◆ continent_array

Continent_record continent_array[]
Initial value:
=
{
{"bar1", 4, true},
{"bar2", 4, true}
}

◆ country_array

Country_record country_array[]
Initial value:
=
{
{"foo1", 4, "bar1", 4, {2016, false}, {10000, false}, {1.11, false}, true},
{"foo2", 4, "bar2", 4, {2016, false}, {1000, false}, {2.22, false}, true}
}

◆ filename

const char* filename = "pfs_example_component_population.log"

◆ log_text

char log_text[MAX_BUFFER_LENGTH] = {'\0'}

◆ mysql_component_pfs_example_component_population

mysql_component_t mysql_component_pfs_example_component_population
Initial value:
= { "mysql:pfs_example_component_population" , __pfs_example_component_population_provides, __pfs_example_component_population_requires, __pfs_example_component_population_metadata,
mysql_service_status_t pfs_example_component_population_deinit()
Terminate the pfs_example_component_population at server shutdown or component deinstallation.
Definition: pfs_example_component_population.cc:197
mysql_service_status_t pfs_example_component_population_init()
Initialize the pfs_example_component_population at server start or component installation.
Definition: pfs_example_component_population.cc:132

◆ outfile

FILE* outfile = NULL

◆ share_list

PFS_engine_table_share_proxy* share_list[2] = {NULL, NULL}

◆ share_list_count

unsigned int share_list_count = 2