MySQL 9.1.0
Source Code Documentation
Rpl_info_table Class Reference

#include <rpl_info_table.h>

Inheritance diagram for Rpl_info_table:
[legend]

Public Member Functions

 ~Rpl_info_table () override
 
- Public Member Functions inherited from Rpl_info_handler
 Rpl_info_handler (const Rpl_info_handler &handler)=delete
 
Rpl_info_handleroperator= (const Rpl_info_handler &handler)=delete
 
int init_info ()
 After creating an object and assembling components, this method is used to initialize internal structures. More...
 
enum_return_check check_info ()
 Checks the repository's status. More...
 
int flush_info (const bool force)
 Flushes and syncs in-memory information into a stable storage (i.e. More...
 
int remove_info ()
 Deletes any information in it and in some cases the repository. More...
 
int clean_info ()
 Deletes any information in the repository. More...
 
void end_info ()
 Closes access to the repository. More...
 
int prepare_info_for_read ()
 Enables the storage system to receive reads, i.e. More...
 
int prepare_info_for_write ()
 Enables the storage system to receive writes, i.e. More...
 
uint get_rpl_info_type ()
 Gets the type of the repository that is used. More...
 
const char * get_rpl_info_type_str ()
 Returns a string corresponding to the type. More...
 
template<class TypeHandler >
bool set_info (TypeHandler const value)
 Sets the value of a field to value. More...
 
template<class TypeHandler >
bool set_info (TypeHandler const value, const size_t size)
 
template<class TypeHandler >
bool set_info (int pk_cursor, TypeHandler const value)
 set the value of a field pointed at pk_cursor to @ value. More...
 
template<class TypeHandlerPointer , class TypeHandler >
enum_field_get_status get_info (TypeHandlerPointer value, TypeHandler const default_value)
 Returns the value of a field. More...
 
template<class TypeHandler >
enum_field_get_status get_info (TypeHandler value, const size_t size, std::add_const_t< std::remove_pointer_t< TypeHandler > > *default_value)
 Returns the value of a string field. More...
 
enum_field_get_status get_info (Server_ids *value, const Server_ids *default_value)
 Returns the value of a Server_id field. More...
 
int get_number_info ()
 Returns the number of fields handled by this handler. More...
 
void set_sync_period (uint period)
 Configures the number of events after which the info (e.g. More...
 
char * get_description_info ()
 Returns a string describing the repository. More...
 
bool is_transactional ()
 Any transactional repository may have its updates rolled back in case of a failure. More...
 
bool update_is_transactional ()
 Updates the value returned by the member function is_transactional() because it may be expensive to compute it whenever is_transactional() is called. More...
 
virtual ~Rpl_info_handler ()
 

Private Member Functions

int do_init_info () override
 
int do_init_info (uint instance) override
 
int do_init_info (enum_find_method method, uint instance)
 
enum_return_check do_check_info () override
 
enum_return_check do_check_info (uint instance) override
 
void do_end_info () override
 
int do_flush_info (const bool force) override
 Flushes and syncs in-memory information into a stable storage. More...
 
int do_remove_info () override
 
int do_clean_info () override
 
int do_prepare_info_for_read () override
 
int do_prepare_info_for_write () override
 
bool do_set_info (const int pos, const char *value) override
 
bool do_set_info (const int pos, const uchar *value, const size_t size) override
 
bool do_set_info (const int pos, const int value) override
 
bool do_set_info (const int pos, const ulong value) override
 
bool do_set_info (const int pos, const float value) override
 
bool do_set_info (const int pos, const Server_ids *value) override
 
bool do_set_info (const int pos, const std::nullptr_t value) override
 Setter needed to set nullable fields to NULL. More...
 
bool do_set_info (const int pos, const std::nullptr_t value, const size_t size) override
 Setter needed to set nullable fields to NULL. More...
 
Rpl_info_handler::enum_field_get_status do_get_info (const int pos, char *value, const size_t size, const char *default_value) override
 
Rpl_info_handler::enum_field_get_status do_get_info (const int pos, uchar *value, const size_t size, const uchar *default_value) override
 
Rpl_info_handler::enum_field_get_status do_get_info (const int pos, int *value, const int default_value) override
 
Rpl_info_handler::enum_field_get_status do_get_info (const int pos, ulong *value, const ulong default_value) override
 
Rpl_info_handler::enum_field_get_status do_get_info (const int pos, float *value, const float default_value) override
 
Rpl_info_handler::enum_field_get_status do_get_info (const int pos, Server_ids *value, const Server_ids *default_value) override
 
char * do_get_description_info () override
 
bool do_is_transactional () override
 
bool do_update_is_transactional () override
 
uint do_get_rpl_info_type () override
 
bool verify_table_primary_key_fields (TABLE *table)
 Verify if the table primary key fields are at the expected (column) position. More...
 
 Rpl_info_table (uint nparam, const char *param_schema, const char *param_table, const uint param_n_pk_fields=0, const uint *param_pk_field_indexes=nullptr, MY_BITMAP const *nullable_bitmap=nullptr)
 
 Rpl_info_table (const Rpl_info_table &info)
 
Rpl_info_tableoperator= (const Rpl_info_table &info)
 

Static Private Member Functions

static bool do_count_info (uint nparam, const char *param_schema, const char *param_table, MY_BITMAP const *nullable_bitmap, ulonglong *counter)
 Returns the number of entries in the table identified by: param_schema.param_table. More...
 
static std::pair< bool, bool > table_in_use (uint nparam, const char *param_schema, const char *param_table, MY_BITMAP const *nullable_bitmap)
 Returns if the table is being used, meaning it contains at least a line or some concurrency related error was returned when looking at the table identified by: param_schema.param_table. More...
 
static int do_reset_info (uint nparam, const char *param_schema, const char *param_table, const char *channel_name, MY_BITMAP const *nullable_bitmap)
 Removes records belonging to the channel_name parameter's channel. More...
 

Private Attributes

LEX_STRING str_schema
 This property identifies the name of the schema where a replication table is created. More...
 
LEX_STRING str_table
 This property identifies the name of a replication table. More...
 
char * description
 This property represents a description of the repository. More...
 
uint m_n_pk_fields
 This property represents the amount of fields in the repository primary key. More...
 
const uint * m_pk_field_indexes
 This property identifies the indexes of the primary keys fields in the table. More...
 
Rpl_info_table_accessaccess
 This is a pointer to a class that facilitates manipulation of replication tables. More...
 
bool is_transactional
 Identifies if a table is transactional or non-transactional. More...
 

Friends

class Rpl_info_factory
 

Additional Inherited Members

- Public Types inherited from Rpl_info_handler
enum class  enum_field_get_status : int { FIELD_VALUE_NOT_NULL = 0 , FIELD_VALUE_IS_NULL = 1 , FAILURE = 2 }
 
- Public Attributes inherited from Rpl_info_handler
Rpl_info_valuesfield_values
 
- Protected Member Functions inherited from Rpl_info_handler
 Rpl_info_handler (const int nparam, MY_BITMAP const *nullable_bitmap)
 
bool is_field_nullable (int pos)
 Checks whether or not the field at position pos is allowed to be NULL. More...
 
- Protected Attributes inherited from Rpl_info_handler
int ninfo
 
int cursor
 
bool prv_error
 
enum_field_get_status prv_get_error
 
uint sync_counter
 
uint sync_period
 
MY_BITMAP nullable_fields
 Bitset holding which of the fields are allowed to be NULL. More...
 

Constructor & Destructor Documentation

◆ ~Rpl_info_table()

Rpl_info_table::~Rpl_info_table ( )
override

◆ Rpl_info_table() [1/2]

Rpl_info_table::Rpl_info_table ( uint  nparam,
const char *  param_schema,
const char *  param_table,
const uint  param_n_pk_fields = 0,
const uint *  param_pk_field_indexes = nullptr,
MY_BITMAP const *  nullable_bitmap = nullptr 
)
private

◆ Rpl_info_table() [2/2]

Rpl_info_table::Rpl_info_table ( const Rpl_info_table info)
private

Member Function Documentation

◆ do_check_info() [1/2]

enum_return_check Rpl_info_table::do_check_info ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_check_info() [2/2]

enum_return_check Rpl_info_table::do_check_info ( uint  instance)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_clean_info()

int Rpl_info_table::do_clean_info ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_count_info()

bool Rpl_info_table::do_count_info ( uint  nparam,
const char *  param_schema,
const char *  param_table,
MY_BITMAP const *  nullable_bitmap,
ulonglong counter 
)
staticprivate

Returns the number of entries in the table identified by: param_schema.param_table.

Parameters
[in]nparamNumber of fields in the table.
[in]param_schemaTable's schema.
[in]param_tableTable's name.
[in]nullable_bitmapbitmap that holds the fields that are allowed to be NULL-
[out]counterNumber of entries found.
Return values
falseSuccess
trueError

◆ do_end_info()

void Rpl_info_table::do_end_info ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_flush_info()

int Rpl_info_table::do_flush_info ( const bool  force)
overrideprivatevirtual

Flushes and syncs in-memory information into a stable storage.

Parameters
[in]forceIf enabled ignore syncing after flushing options such as relay-log-info-sync and master-info-sync and always sync
Return values
0Success
nonzeroFailure This can happen if there is an error writing the table, or if replica_preserve_commit_order is enabled and a previous transaction has failed. In both cases, the error has been reported already.

Implements Rpl_info_handler.

◆ do_get_description_info()

char * Rpl_info_table::do_get_description_info ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_get_info() [1/6]

Rpl_info_handler::enum_field_get_status Rpl_info_table::do_get_info ( const int  pos,
char *  value,
const size_t  size,
const char *  default_value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_get_info() [2/6]

Rpl_info_handler::enum_field_get_status Rpl_info_table::do_get_info ( const int  pos,
float *  value,
const float  default_value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_get_info() [3/6]

Rpl_info_handler::enum_field_get_status Rpl_info_table::do_get_info ( const int  pos,
int *  value,
const int  default_value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_get_info() [4/6]

Rpl_info_handler::enum_field_get_status Rpl_info_table::do_get_info ( const int  pos,
Server_ids value,
const Server_ids default_value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_get_info() [5/6]

Rpl_info_handler::enum_field_get_status Rpl_info_table::do_get_info ( const int  pos,
uchar value,
const size_t  size,
const uchar default_value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_get_info() [6/6]

Rpl_info_handler::enum_field_get_status Rpl_info_table::do_get_info ( const int  pos,
ulong *  value,
const ulong  default_value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_get_rpl_info_type()

uint Rpl_info_table::do_get_rpl_info_type ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_init_info() [1/3]

int Rpl_info_table::do_init_info ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_init_info() [2/3]

int Rpl_info_table::do_init_info ( enum_find_method  method,
uint  instance 
)
private

◆ do_init_info() [3/3]

int Rpl_info_table::do_init_info ( uint  instance)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_is_transactional()

bool Rpl_info_table::do_is_transactional ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_prepare_info_for_read()

int Rpl_info_table::do_prepare_info_for_read ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_prepare_info_for_write()

int Rpl_info_table::do_prepare_info_for_write ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_remove_info()

int Rpl_info_table::do_remove_info ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_reset_info()

int Rpl_info_table::do_reset_info ( uint  nparam,
const char *  param_schema,
const char *  param_table,
const char *  channel_name,
MY_BITMAP const *  nullable_bitmap 
)
staticprivate

Removes records belonging to the channel_name parameter's channel.

Parameters
nparamnumber of fields in the table
param_schemaschema name
param_tabletable name
channel_namechannel name
nullable_bitmapfields allowed to be null.
Returns
0 on success 1 when a failure happens

◆ do_set_info() [1/8]

bool Rpl_info_table::do_set_info ( const int  pos,
const char *  value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_set_info() [2/8]

bool Rpl_info_table::do_set_info ( const int  pos,
const float  value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_set_info() [3/8]

bool Rpl_info_table::do_set_info ( const int  pos,
const int  value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_set_info() [4/8]

bool Rpl_info_table::do_set_info ( const int  pos,
const Server_ids value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_set_info() [5/8]

bool Rpl_info_table::do_set_info ( const int  pos,
const std::nullptr_t  value 
)
overrideprivatevirtual

Setter needed to set nullable fields to NULL.

Parameters
posthe index of the field to set to NULL.
valueunused value, needed to desimbiguate polimorphism.
Returns
true if there was an error and false otherwise.

Implements Rpl_info_handler.

◆ do_set_info() [6/8]

bool Rpl_info_table::do_set_info ( const int  pos,
const std::nullptr_t  value,
const size_t  size 
)
overrideprivatevirtual

Setter needed to set nullable fields to NULL.

Parameters
posthe index of the field to set to NULL.
valueunused value, needed to desimbiguate polimorphism.
sizeunused value size, needed to desimbiguate polimorphism.
Returns
true if there was an error and false otherwise.

Implements Rpl_info_handler.

◆ do_set_info() [7/8]

bool Rpl_info_table::do_set_info ( const int  pos,
const uchar value,
const size_t  size 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_set_info() [8/8]

bool Rpl_info_table::do_set_info ( const int  pos,
const ulong  value 
)
overrideprivatevirtual

Implements Rpl_info_handler.

◆ do_update_is_transactional()

bool Rpl_info_table::do_update_is_transactional ( )
overrideprivatevirtual

Implements Rpl_info_handler.

◆ operator=()

Rpl_info_table & Rpl_info_table::operator= ( const Rpl_info_table info)
private

◆ table_in_use()

std::pair< bool, bool > Rpl_info_table::table_in_use ( uint  nparam,
const char *  param_schema,
const char *  param_table,
MY_BITMAP const *  nullable_bitmap 
)
staticprivate

Returns if the table is being used, meaning it contains at least a line or some concurrency related error was returned when looking at the table identified by: param_schema.param_table.

Parameters
[in]nparamNumber of fields in the table.
[in]param_schemaTable's schema.
[in]param_tableTable's name.
[in]nullable_bitmapbitmap that holds the fields that are allowed to be NULL-
Return values
apair of booleans First element is true if an error occurred, false otherwise. Second element is true if the table is not empty or an access error occurred meaning someone else is accessing it. False if the table is empty.

◆ verify_table_primary_key_fields()

bool Rpl_info_table::verify_table_primary_key_fields ( TABLE table)
private

Verify if the table primary key fields are at the expected (column) position.

Parameters
tableThe table handle where the verification will be done.
Returns
false if the table primary key fields are fine.
true if problems were found with table primary key fields.

Friends And Related Function Documentation

◆ Rpl_info_factory

friend class Rpl_info_factory
friend

Member Data Documentation

◆ access

Rpl_info_table_access* Rpl_info_table::access
private

This is a pointer to a class that facilitates manipulation of replication tables.

◆ description

char* Rpl_info_table::description
private

This property represents a description of the repository.

Specifically, "schema"."table".

◆ is_transactional

bool Rpl_info_table::is_transactional
private

Identifies if a table is transactional or non-transactional.

This is used to provide a crash-safe behaviour.

◆ m_n_pk_fields

uint Rpl_info_table::m_n_pk_fields
private

This property represents the amount of fields in the repository primary key.

◆ m_pk_field_indexes

const uint* Rpl_info_table::m_pk_field_indexes
private

This property identifies the indexes of the primary keys fields in the table.

◆ str_schema

LEX_STRING Rpl_info_table::str_schema
private

This property identifies the name of the schema where a replication table is created.

◆ str_table

LEX_STRING Rpl_info_table::str_table
private

This property identifies the name of a replication table.


The documentation for this class was generated from the following files: