MySQL 8.0.37
Source Code Documentation
table.cc File Reference
#include "sql/dd/upgrade_57/table.h"
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <algorithm>
#include <string>
#include "lex_string.h"
#include "m_string.h"
#include "my_alloc.h"
#include "my_base.h"
#include "my_dbug.h"
#include "my_dir.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_loglevel.h"
#include "my_sys.h"
#include "my_user.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/udf_registration_types.h"
#include "mysql_com.h"
#include "mysqld_error.h"
#include "sql/dd/cache/dictionary_client.h"
#include "sql/dd/dd.h"
#include "sql/dd/dd_schema.h"
#include "sql/dd/dd_table.h"
#include "sql/dd/dd_trigger.h"
#include "sql/dd/dd_view.h"
#include "sql/dd/dictionary.h"
#include "sql/dd/impl/upgrade/server.h"
#include "sql/dd/impl/utils.h"
#include "sql/dd/properties.h"
#include "sql/dd/string_type.h"
#include "sql/dd/types/foreign_key.h"
#include "sql/dd/types/table.h"
#include "sql/dd/upgrade_57/global.h"
#include "sql/dd/upgrade_57/upgrade.h"
#include "sql/field.h"
#include "sql/handler.h"
#include "sql/key.h"
#include "sql/lock.h"
#include "sql/log.h"
#include "sql/mdl.h"
#include "sql/mysqld.h"
#include "sql/parse_file.h"
#include "sql/partition_element.h"
#include "sql/partition_info.h"
#include "sql/psi_memory_key.h"
#include "sql/sp_head.h"
#include "sql/sql_alter.h"
#include "sql/sql_base.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_lex.h"
#include "sql/sql_list.h"
#include "sql/sql_parse.h"
#include "sql/sql_show.h"
#include "sql/sql_table.h"
#include "sql/sql_view.h"
#include "sql/system_variables.h"
#include "sql/table.h"
#include "sql/table_trigger_dispatcher.h"
#include "sql/thd_raii.h"
#include "sql/thr_malloc.h"
#include "sql/transaction.h"
#include "sql/trigger.h"
#include "sql/trigger_chain.h"
#include "sql/trigger_def.h"
#include "sql_string.h"
#include "thr_lock.h"

Classes

class  dd::upgrade_57::Trigger_loader
 Class to handle loading and parsing of Triggers. More...
 
struct  dd::upgrade_57::Trg_file_data
 Structure representing contents of .TRG file. More...
 
class  dd::upgrade_57::Handle_old_incorrect_sql_modes_hook
 
class  dd::upgrade_57::Upgrade_MDL_guard
 RAII to handle MDL locks while upgrading. More...
 
class  dd::upgrade_57::Table_upgrade_guard
 RAII to handle cleanup after table upgrading. More...
 

Namespaces

namespace  dd
 The version of the current data dictionary table definitions.
 
namespace  dd::bootstrap
 
namespace  dd::upgrade_57
 

Macros

#define my_offsetof_upgrade(TYPE, MEMBER)    ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char *)0x10))
 
#define INVALID_SQL_MODES_LENGTH   13
 Trigger BUG#14090 compatibility hook. More...
 

Functions

bool dd::bootstrap::invalid_triggers (THD *thd, const char *schema_name, const dd::Table &table)
 Validate all the triggers of the given table. More...
 
static bool dd::upgrade_57::is_equal (const LEX_CSTRING &a, const LEX_CSTRING &b)
 
static void dd::upgrade_57::fill_create_info_for_upgrade (HA_CREATE_INFO *create_info, const TABLE *table)
 Fill HA_CREATE_INFO from TABLE_SHARE. More...
 
static bool dd::upgrade_57::create_unlinked_view (THD *thd, Table_ref *view_ref)
 Create the view in DD without its column and dependency information. More...
 
static void dd::upgrade_57::create_alter_view_stmt (const THD *thd, Table_ref *view_ref, String *str, const String_type &db_name, const String_type &view_name, const CHARSET_INFO *cs)
 Construct ALTER VIEW statement to fix the column list and dependency information but retains the previous view definition entry in DD. More...
 
static bool dd::upgrade_57::fix_view_cols_and_deps (THD *thd, Table_ref *view_ref, const String_type &db_name, const String_type &view_name)
 Finalize upgrading view by fixing column data, table and routines dependency. More...
 
static bool dd::upgrade_57::migrate_view_to_dd (THD *thd, const FRM_context &frm_context, const String_type &db_name, const String_type &view_name, MEM_ROOT *mem_root, bool is_fix_view_cols_and_deps)
 Create an entry in the DD for the view. More...
 
static bool dd::upgrade_57::fill_partition_info_for_upgrade (THD *thd, TABLE_SHARE *share, const FRM_context *frm_context, TABLE *table)
 Create partition information for upgrade. More...
 
static bool dd::upgrade_57::invalid_triggers (Table_trigger_dispatcher *d, List<::Trigger > &triggers)
 
static bool dd::upgrade_57::add_triggers_to_table (THD *thd, TABLE *table, const String_type &schema_name, const String_type &table_name)
 Add triggers to table. More...
 
static bool dd::upgrade_57::fix_generated_columns_for_upgrade (THD *thd, TABLE *table, List< Create_field > &create_fields)
 Fix generated columns. More...
 
static bool dd::upgrade_57::set_se_data_for_user_tables (THD *thd, const String_type &schema_name, const String_type &table_name, TABLE *table, bool skip_error)
 Call handler API to get storate engine specific metadata. More...
 
static bool dd::upgrade_57::fix_fk_parent_key_names (THD *thd, const String_type &schema_name, const String_type &table_name, handlerton *hton)
 Set names of parent keys (unique constraint names matching FK in parent tables) for the FKs in which table participates. More...
 
static bool dd::upgrade_57::migrate_table_to_dd (THD *thd, const String_type &schema_name, const String_type &table_name, bool is_fix_view_cols_and_deps)
 Read .frm files and enter metadata for tables/views. More...
 
bool dd::upgrade_57::migrate_plugin_table_to_dd (THD *thd)
 Upgrade mysql.plugin table. More...
 
static bool dd::upgrade_57::is_skipped_ndb_table (const char *db_name, const char *table_name)
 Migration of NDB tables is deferred until later, except for: More...
 
bool dd::upgrade_57::migrate_all_frm_to_dd (THD *thd, const char *dbname, bool is_fix_view_cols_and_deps)
 Scan the database to identify all .frm files. More...
 

Variables

static const int dd::upgrade_57::TRG_NUM_REQUIRED_PARAMETERS = 8
 
const LEX_CSTRING dd::upgrade_57::trg_file_type = {STRING_WITH_LEN("TRIGGERS")}
 
static File_option dd::upgrade_57::trg_file_parameters []
 Table of .TRG file field descriptors. More...
 
static File_option dd::upgrade_57::sql_modes_parameters
 
static LEX_STRING dd::upgrade_57::default_client_cs_name = NULL_STR
 
static LEX_STRING dd::upgrade_57::default_connection_cl_name = NULL_STR
 
static LEX_STRING dd::upgrade_57::default_db_cl_name = NULL_STR
 
static const int dd::upgrade_57::REQUIRED_VIEW_PARAMETERS = 12
 
static File_option dd::upgrade_57::view_parameters []
 

Macro Definition Documentation

◆ INVALID_SQL_MODES_LENGTH

#define INVALID_SQL_MODES_LENGTH   13

Trigger BUG#14090 compatibility hook.

Parameters
[in,out]unknown_keyreference on the line with unknown parameter and the parsing point
[in]basebase address for parameter writing (structure like TABLE)
[in]mem_rootMEM_ROOT for parameters allocation
[in]endthe end of the configuration
Note
NOTE: this hook process back compatibility for incorrectly written sql_modes parameter (see BUG#14090).
Return values
falseOK
trueError

◆ my_offsetof_upgrade

#define my_offsetof_upgrade (   TYPE,
  MEMBER 
)     ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char *)0x10))