MySQL 9.0.0
Source Code Documentation
mysqlcheck_core.cc File Reference
#include <mysql_version.h>
#include <mysqld_error.h>
#include <sys/types.h>
#include <string>
#include <vector>
#include "client/check/mysqlcheck.h"
#include "client/include/client_priv.h"
#include "m_string.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "mysql/strings/m_ctype.h"

Namespaces

namespace  Mysql
 
namespace  Mysql::Tools
 
namespace  Mysql::Tools::Check
 

Macros

#define MAX_ALTER_STR_SIZE   128 * 1024
 
#define KEY_PARTITIONING_CHANGED_STR   "KEY () partitioning changed"
 

Functions

static int process_all_databases ()
 
static int process_databases (const vector< string > &db_names)
 
static int process_selected_tables (const string &db, const vector< string > &table_names)
 
static int process_all_tables_in_db (const string &database)
 
static int process_one_db (const string &database)
 
static int use_db (const string &database)
 
static int handle_request_for_tables (const string &tables)
 
static void print_result ()
 
static string escape_table_name (const string &src)
 
static void escape_str (const string &src, size_t start, size_t end, string &res)
 
static string escape_db_table_name (const string &src, size_t dot_pos)
 
static int run_query (const string &query)
 
static int rebuild_table (const string &name)
 
static int disable_binlog ()
 
void Mysql::Tools::Check::mysql_check (MYSQL *connection, int what_to_do, bool opt_alldbs, bool opt_check_only_changed, bool opt_extended, bool opt_databases, bool opt_fast, bool opt_medium_check, bool opt_quick, bool opt_all_in_1, bool opt_silent, bool opt_auto_repair, bool ignore_errors, bool opt_frm, bool opt_fix_table_names, bool opt_fix_db_names, bool opt_upgrade, bool opt_write_binlog, uint verbose, std::string opt_skip_database, std::vector< std::string > arguments, void(*dberror)(MYSQL *mysql, const std::string &when))
 

Variables

static MYSQLsock = nullptr
 
static bool opt_alldbs = false
 
static bool opt_check_only_changed = false
 
static bool opt_extended = false
 
static bool opt_databases = false
 
static bool opt_fast = false
 
static bool opt_medium_check = false
 
static bool opt_quick = false
 
static bool opt_all_in_1 = false
 
static bool opt_silent = false
 
static bool opt_auto_repair = false
 
static bool ignore_errors = false
 
static bool opt_frm = false
 
static bool opt_fix_table_names = false
 
static bool opt_fix_db_names = false
 
static bool opt_upgrade = false
 
static bool opt_write_binlog = true
 
static uint verbose = 0
 
static string opt_skip_database
 
int what_to_do = 0
 
void(* DBError )(MYSQL *mysql, const string &when)
 
static int first_error = 0
 
vector< string > tables4repair
 
vector< string > tables4rebuild
 
vector< string > alter_table_cmds
 

Macro Definition Documentation

◆ KEY_PARTITIONING_CHANGED_STR

#define KEY_PARTITIONING_CHANGED_STR   "KEY () partitioning changed"

◆ MAX_ALTER_STR_SIZE

#define MAX_ALTER_STR_SIZE   128 * 1024

Function Documentation

◆ disable_binlog()

static int disable_binlog ( )
static

◆ escape_db_table_name()

static string escape_db_table_name ( const string &  src,
size_t  dot_pos 
)
static

◆ escape_str()

static void escape_str ( const string &  src,
size_t  start,
size_t  end,
string &  res 
)
inlinestatic

◆ escape_table_name()

static string escape_table_name ( const string &  src)
static

◆ handle_request_for_tables()

static int handle_request_for_tables ( const string &  tables)
static

◆ print_result()

static void print_result ( )
static

◆ process_all_databases()

static int process_all_databases ( )
static

◆ process_all_tables_in_db()

static int process_all_tables_in_db ( const string &  database)
static

◆ process_databases()

static int process_databases ( const vector< string > &  db_names)
static

◆ process_one_db()

static int process_one_db ( const string &  database)
static

◆ process_selected_tables()

static int process_selected_tables ( const string &  db,
const vector< string > &  table_names 
)
static

◆ rebuild_table()

static int rebuild_table ( const string &  name)
static

◆ run_query()

static int run_query ( const string &  query)
static

◆ use_db()

static int use_db ( const string &  database)
static

Variable Documentation

◆ alter_table_cmds

vector<string> alter_table_cmds

◆ DBError

void(* DBError) (MYSQL *mysql, const string &when) ( MYSQL mysql,
const string &  when 
)

◆ first_error

int first_error = 0
static

◆ ignore_errors

bool ignore_errors = false
static

◆ opt_all_in_1

bool opt_all_in_1 = false
static

◆ opt_alldbs

bool opt_alldbs = false
static

◆ opt_auto_repair

bool opt_auto_repair = false
static

◆ opt_check_only_changed

bool opt_check_only_changed = false
static

◆ opt_databases

bool opt_databases = false
static

◆ opt_extended

bool opt_extended = false
static

◆ opt_fast

bool opt_fast = false
static

◆ opt_fix_db_names

bool opt_fix_db_names = false
static

◆ opt_fix_table_names

bool opt_fix_table_names = false
static

◆ opt_frm

bool opt_frm = false
static

◆ opt_medium_check

bool opt_medium_check = false
static

◆ opt_quick

bool opt_quick = false
static

◆ opt_silent

bool opt_silent = false
static

◆ opt_skip_database

string opt_skip_database
static

◆ opt_upgrade

bool opt_upgrade = false
static

◆ opt_write_binlog

bool opt_write_binlog = true
static

◆ sock

MYSQL* sock = nullptr
static

◆ tables4rebuild

vector<string> tables4rebuild

◆ tables4repair

vector<string> tables4repair

◆ verbose

uint verbose = 0
static

◆ what_to_do

int what_to_do = 0