MySQL 26.7.0
Source Code Documentation
dd::upgrade::anonymous_namespace{server.cc} Namespace Reference

Namespaces

namespace  anonymous_namespace{server.cc}
 

Classes

class  MySQL_check
 
class  Server_option_guard
 
class  Sql_fun_error_handler
 

Functions

dd::String_typeappend_escaped (dd::String_type &dst, const dd::String_type &s)
 
void comma_separated_join (std::vector< dd::String_type > &list, dd::String_type &dest)
 
bool ignore_error_and_execute (THD *thd, const char *query_ptr, bool print_err=true)
 
static bool reinstall_firewall_procedures (THD *thd, const char *drop_query, const char *fw_proc[])
 This function will create the firewall's stored procedures. More...
 
static bool upgrade_firewall_procedures (THD *thd)
 This function will check and create the firewall's stored procedures. More...
 
static bool switch_to_firewall_schema (THD *thd, std::string &fw_schema)
 This function will switch to the schema which is pointed by the mysql-firewall-database variable by executing USE. More...
 
static bool upgrade_firewall (THD *thd)
 upgrades Firewall stored procedures More...
 
bool fix_sys_schema (THD *thd)
 
bool fix_mysql_tables (THD *thd)
 
bool upgrade_help_tables (THD *thd)
 
static bool get_shared_tablespace_names (THD *thd, std::set< dd::String_type > *shared_spaces)
 
bool check_single_table_funs (THD *thd, const dd::String_type &sn, const dd::Table *table, Upgrade_error_counter *error_count)
 Check table definitions for SQL functions. More...
 
bool check_single_table (THD *thd, const dd::String_type &sn, const dd::Table *table, const std::set< dd::String_type > *shared_spaces, Upgrade_error_counter *error_count)
 Checks the dd information for (without opening) a single table. More...
 
bool check_all_events (THD *thd, const Schema_name_index &sni, Upgrade_error_counter *error_count)
 Scans mysql.events and performs upgrade checks for events. More...
 
bool check_all_routines (THD *thd, const Schema_name_index &sni, Syntax_error_handler &, Upgrade_error_counter *error_count)
 Scans mysql.routines and performs upgrade checks for routines. More...
 
static void remove_legacy_upgrade_info_file ()
 

Variables

static std::vector< uint > ignored_errors
 
const dd::String_type MYSQL_SCHEMA_NAME = "mysql"
 
const dd::String_type SYS_SCHEMA_NAME = "sys"
 

Function Documentation

◆ append_escaped()

dd::String_type & dd::upgrade::anonymous_namespace{server.cc}::append_escaped ( dd::String_type dst,
const dd::String_type s 
)

◆ check_all_events()

bool dd::upgrade::anonymous_namespace{server.cc}::check_all_events ( THD thd,
const Schema_name_index sni,
Upgrade_error_counter error_count 
)

Scans mysql.events and performs upgrade checks for events.

Parameters
thdTHD
sniSchema names indexed on schema_id
[out]error_counterror counter object
Returns
true if too many error encountered

◆ check_all_routines()

bool dd::upgrade::anonymous_namespace{server.cc}::check_all_routines ( THD thd,
const Schema_name_index sni,
Syntax_error_handler ,
Upgrade_error_counter error_count 
)

Scans mysql.routines and performs upgrade checks for routines.

Parameters
thdTHD
sniSchema names indexed on schema_id
[out]error_counterror counter object
Returns
true if too many error encountered

◆ check_single_table()

bool dd::upgrade::anonymous_namespace{server.cc}::check_single_table ( THD thd,
const dd::String_type sn,
const dd::Table table,
const std::set< dd::String_type > *  shared_spaces,
Upgrade_error_counter error_count 
)

Checks the dd information for (without opening) a single table.

Parameters
thdTHD
snSchema name
tableTable object
shared_spacesset of shared tablespace names
error_counterror counter object

◆ check_single_table_funs()

bool dd::upgrade::anonymous_namespace{server.cc}::check_single_table_funs ( THD thd,
const dd::String_type sn,
const dd::Table table,
Upgrade_error_counter error_count 
)

Check table definitions for SQL functions.

Sometimes, improving a SQL function's behaviour or diagnostics may result in an error being thrown in situations where this wasn't the case. If that call is part of a table's definition, the error will be thrown during the opening of the table, which will then fail.

This is something the user will generally want to know before putting an upgraded database into production. Therefore, we inspect all user tables that (potentially) have SQL functions in DEFAULT clauses, PARTITIONing, virtual columns, or indexes. Any such table we try to open. This may take a while, but it is preferable to not being aware of breakage.

Parameters
thdThe THD to use.
snThe schema name whose tables to examine.
tableTable dd object from scan
error_countCount of errors (total for all check functions)
Returns
false True if too many errors were detected, false otherwise.

◆ comma_separated_join()

void dd::upgrade::anonymous_namespace{server.cc}::comma_separated_join ( std::vector< dd::String_type > &  list,
dd::String_type dest 
)

◆ fix_mysql_tables()

bool dd::upgrade::anonymous_namespace{server.cc}::fix_mysql_tables ( THD thd)

◆ fix_sys_schema()

bool dd::upgrade::anonymous_namespace{server.cc}::fix_sys_schema ( THD thd)

◆ get_shared_tablespace_names()

static bool dd::upgrade::anonymous_namespace{server.cc}::get_shared_tablespace_names ( THD thd,
std::set< dd::String_type > *  shared_spaces 
)
static

◆ ignore_error_and_execute()

bool dd::upgrade::anonymous_namespace{server.cc}::ignore_error_and_execute ( THD thd,
const char *  query_ptr,
bool  print_err = true 
)

◆ reinstall_firewall_procedures()

static bool dd::upgrade::anonymous_namespace{server.cc}::reinstall_firewall_procedures ( THD thd,
const char *  drop_query,
const char *  fw_proc[] 
)
static

This function will create the firewall's stored procedures.

Parameters
[in]thdthread context
[in]drop_queryDROP statement to drop procedure
[in]fw_procstored procedure's SQL definition
Return values
falseexecution of query successful
trueexecution of query failed

◆ remove_legacy_upgrade_info_file()

static void dd::upgrade::anonymous_namespace{server.cc}::remove_legacy_upgrade_info_file ( )
static

◆ switch_to_firewall_schema()

static bool dd::upgrade::anonymous_namespace{server.cc}::switch_to_firewall_schema ( THD thd,
std::string &  fw_schema 
)
static

This function will switch to the schema which is pointed by the mysql-firewall-database variable by executing USE.

Parameters
[in]thdthread context
[out]fw_schemavalue of mysql-firewall-database
Return values
falseexecution of USE successful
trueexecution of USE failed

◆ upgrade_firewall()

static bool dd::upgrade::anonymous_namespace{server.cc}::upgrade_firewall ( THD thd)
static

upgrades Firewall stored procedures

◆ upgrade_firewall_procedures()

static bool dd::upgrade::anonymous_namespace{server.cc}::upgrade_firewall_procedures ( THD thd)
static

This function will check and create the firewall's stored procedures.

Parameters
[in]thdthread context
Return values
falseexecution of query successful
trueexecution of query failed

◆ upgrade_help_tables()

bool dd::upgrade::anonymous_namespace{server.cc}::upgrade_help_tables ( THD thd)

Variable Documentation

◆ ignored_errors

std::vector<uint> dd::upgrade::anonymous_namespace{server.cc}::ignored_errors
static
Initial value:
{
ER_DUP_FIELDNAME, ER_DUP_KEYNAME, ER_BAD_FIELD_ERROR,
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2, ER_DUP_ENTRY}

◆ MYSQL_SCHEMA_NAME

const dd::String_type dd::upgrade::anonymous_namespace{server.cc}::MYSQL_SCHEMA_NAME = "mysql"

◆ SYS_SCHEMA_NAME

const dd::String_type dd::upgrade::anonymous_namespace{server.cc}::SYS_SCHEMA_NAME = "sys"