MySQL 9.1.0
Source Code Documentation
Mysql::Tools::Check::Program Class Reference

This class is object wrapper to mysql_check function. More...

#include <mysqlcheck.h>

Public Member Functions

 Program ()
 Default constructor. More...
 
int check_databases (MYSQL *connection, const std::vector< std::string > &databases)
 Checks specified databases on MySQL server. More...
 
int check_all_databases (MYSQL *connection)
 Checks all databases on MySQL server. More...
 
Programenable_auto_repair (bool enable)
 Automatically try to fix table when upgrade is needed. More...
 
Programenable_upgrade (bool enable)
 Check and upgrade tables. More...
 
Programenable_verbosity (bool enable)
 Turns on verbose messages. More...
 
Programenable_writing_binlog (bool enable)
 Enables logging repairing queries to binlog. More...
 
Programenable_fixing_table_names (bool enable)
 Enables table name fixing for all encountered tables. More...
 
Programenable_fixing_db_names (bool enable)
 Enables database name fixing for all encountered databases. More...
 
Programset_ignore_errors (bool ignore)
 Ignores all errors and don't print error messages. More...
 
Programset_skip_database (std::string database)
 Sets a name of database to ignore during process. More...
 
Programset_error_callback (void(*error_callback)(MYSQL *mysql, const std::string &when))
 Sets error callback to be called when error is encountered. More...
 

Private Member Functions

Programset_what_to_do (int functionality)
 Sets mysqlcheck program operation type to perform. More...
 
int execute (const std::vector< std::string > &positional_options)
 Starts mysqlcheck process. More...
 

Private Attributes

int m_what_to_do
 
bool m_auto_repair
 
bool m_upgrade
 
bool m_verbose
 
bool m_ignore_errors
 
bool m_write_binlog
 
bool m_process_all_dbs
 
bool m_fix_table_names
 
bool m_fix_db_names
 
MYSQLm_connection
 
std::string m_database_to_skip
 
void(* m_error_callback )(MYSQL *mysql, const std::string &when)
 

Related Functions

(Note that these are not member functions.)

int execute (const vector< string > &positional_options)
 

Detailed Description

This class is object wrapper to mysql_check function.

It looks like it is implementing Abstract_program, but it is not explicitly implementing it now. This is to make future implementation of Abstract_program easier.

Constructor & Destructor Documentation

◆ Program()

Program::Program ( )

Default constructor.

Member Function Documentation

◆ check_all_databases()

int Program::check_all_databases ( MYSQL connection)

Checks all databases on MySQL server.

◆ check_databases()

int Program::check_databases ( MYSQL connection,
const std::vector< std::string > &  databases 
)

Checks specified databases on MySQL server.

◆ enable_auto_repair()

Program * Program::enable_auto_repair ( bool  enable)

Automatically try to fix table when upgrade is needed.

◆ enable_fixing_db_names()

Program * Program::enable_fixing_db_names ( bool  enable)

Enables database name fixing for all encountered databases.

◆ enable_fixing_table_names()

Program * Program::enable_fixing_table_names ( bool  enable)

Enables table name fixing for all encountered tables.

◆ enable_upgrade()

Program * Program::enable_upgrade ( bool  enable)

Check and upgrade tables.

◆ enable_verbosity()

Program * Program::enable_verbosity ( bool  enable)

Turns on verbose messages.

◆ enable_writing_binlog()

Program * Program::enable_writing_binlog ( bool  enable)

Enables logging repairing queries to binlog.

◆ execute()

int Mysql::Tools::Check::Program::execute ( const std::vector< std::string > &  positional_options)
private

Starts mysqlcheck process.

◆ set_error_callback()

Program * Program::set_error_callback ( void(*)(MYSQL *mysql, const std::string &when)  error_callback)

Sets error callback to be called when error is encountered.

◆ set_ignore_errors()

Program * Program::set_ignore_errors ( bool  ignore)

Ignores all errors and don't print error messages.

◆ set_skip_database()

Program * Program::set_skip_database ( std::string  database)

Sets a name of database to ignore during process.

◆ set_what_to_do()

Program * Program::set_what_to_do ( int  functionality)
private

Sets mysqlcheck program operation type to perform.

Friends And Related Function Documentation

◆ execute()

int execute ( const vector< string > &  positional_options)
related

Member Data Documentation

◆ m_auto_repair

bool Mysql::Tools::Check::Program::m_auto_repair
private

◆ m_connection

MYSQL* Mysql::Tools::Check::Program::m_connection
private

◆ m_database_to_skip

std::string Mysql::Tools::Check::Program::m_database_to_skip
private

◆ m_error_callback

void(* Mysql::Tools::Check::Program::m_error_callback) (MYSQL *mysql, const std::string &when)
private

◆ m_fix_db_names

bool Mysql::Tools::Check::Program::m_fix_db_names
private

◆ m_fix_table_names

bool Mysql::Tools::Check::Program::m_fix_table_names
private

◆ m_ignore_errors

bool Mysql::Tools::Check::Program::m_ignore_errors
private

◆ m_process_all_dbs

bool Mysql::Tools::Check::Program::m_process_all_dbs
private

◆ m_upgrade

bool Mysql::Tools::Check::Program::m_upgrade
private

◆ m_verbose

bool Mysql::Tools::Check::Program::m_verbose
private

◆ m_what_to_do

int Mysql::Tools::Check::Program::m_what_to_do
private

◆ m_write_binlog

bool Mysql::Tools::Check::Program::m_write_binlog
private

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