MySQL 9.1.0
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_AS (pfs_plugin_table_v1, pt_srv)
 
 REQUIRES_SERVICE_PLACEHOLDER_AS (pfs_plugin_column_string_v2, pc_string_srv)
 
 REQUIRES_SERVICE_PLACEHOLDER_AS (pfs_plugin_column_year_v1, pc_year_srv)
 
 REQUIRES_SERVICE_PLACEHOLDER_AS (pfs_plugin_column_bigint_v1, pc_bigint_srv)
 
 REQUIRES_SERVICE_PLACEHOLDER_AS (pfs_plugin_column_double_v1, pc_double_srv)
 
 REQUIRES_SERVICE_PLACEHOLDER_AS (pfs_plugin_column_text_v1, pc_text_srv)
 
 REQUIRES_SERVICE_AS (pfs_plugin_table_v1, pt_srv)
 
 REQUIRES_SERVICE_AS (pfs_plugin_column_string_v2, pc_string_srv)
 
 REQUIRES_SERVICE_AS (pfs_plugin_column_year_v1, pc_year_srv)
 
 REQUIRES_SERVICE_AS (pfs_plugin_column_bigint_v1, pc_bigint_srv)
 
 REQUIRES_SERVICE_AS (pfs_plugin_column_double_v1, pc_double_srv)
 
 REQUIRES_SERVICE_AS (pfs_plugin_column_text_v1, pc_text_srv)
 
 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 = nullptr
 
const char * filename = "pfs_example_component_population.log"
 
char log_text [MAX_BUFFER_LENGTH] = {'\0'}
 
PFS_engine_table_share_proxyshare_list [2] = {nullptr, nullptr}
 
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); \
if (fwrite((uchar *)log_text, sizeof(char), strlen(log_text), outfile) != \
strlen(log_text)) \
return true; \
}
unsigned char uchar
Definition: my_inttypes.h:52
char log_text[MAX_BUFFER_LENGTH]
Definition: pfs_example_component_population.cc:68
FILE * outfile
Definition: pfs_example_component_population.cc:66

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_v1 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_v1 service.
Return values
0success
non-zerofailure

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

◆ REQUIRES_SERVICE_AS() [1/6]

REQUIRES_SERVICE_AS ( pfs_plugin_column_bigint_v1  ,
pc_bigint_srv   
)

◆ REQUIRES_SERVICE_AS() [2/6]

REQUIRES_SERVICE_AS ( pfs_plugin_column_double_v1  ,
pc_double_srv   
)

◆ REQUIRES_SERVICE_AS() [3/6]

REQUIRES_SERVICE_AS ( pfs_plugin_column_string_v2  ,
pc_string_srv   
)

◆ REQUIRES_SERVICE_AS() [4/6]

REQUIRES_SERVICE_AS ( pfs_plugin_column_text_v1  ,
pc_text_srv   
)

◆ REQUIRES_SERVICE_AS() [5/6]

REQUIRES_SERVICE_AS ( pfs_plugin_column_year_v1  ,
pc_year_srv   
)

◆ REQUIRES_SERVICE_AS() [6/6]

REQUIRES_SERVICE_AS ( pfs_plugin_table_v1  ,
pt_srv   
)

◆ REQUIRES_SERVICE_PLACEHOLDER_AS() [1/6]

REQUIRES_SERVICE_PLACEHOLDER_AS ( pfs_plugin_column_bigint_v1  ,
pc_bigint_srv   
)

◆ REQUIRES_SERVICE_PLACEHOLDER_AS() [2/6]

REQUIRES_SERVICE_PLACEHOLDER_AS ( pfs_plugin_column_double_v1  ,
pc_double_srv   
)

◆ REQUIRES_SERVICE_PLACEHOLDER_AS() [3/6]

REQUIRES_SERVICE_PLACEHOLDER_AS ( pfs_plugin_column_string_v2  ,
pc_string_srv   
)

◆ REQUIRES_SERVICE_PLACEHOLDER_AS() [4/6]

REQUIRES_SERVICE_PLACEHOLDER_AS ( pfs_plugin_column_text_v1  ,
pc_text_srv   
)

◆ REQUIRES_SERVICE_PLACEHOLDER_AS() [5/6]

REQUIRES_SERVICE_PLACEHOLDER_AS ( pfs_plugin_column_year_v1  ,
pc_year_srv   
)

◆ REQUIRES_SERVICE_PLACEHOLDER_AS() [6/6]

REQUIRES_SERVICE_PLACEHOLDER_AS ( pfs_plugin_table_v1  ,
pt_srv   
)

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, "FO1", 3, {2016, false}, {10000, false}, {1.11, false}, true},
{"foo2", 4, "bar2", 4, "FO2", 3, {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:203
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:139

◆ outfile

FILE* outfile = nullptr

◆ share_list

◆ share_list_count

unsigned int share_list_count = 2