153#ifndef UNIV_HOTBACKUP
221 "flags",
"id",
"discard",
"server_version",
"space_version",
"state"};
237 "autoinc",
"data_directory",
"version",
"discard",
"instant_col"};
241 "default",
"default_null",
"version_added",
"version_dropped",
246 "format",
"instant_col",
"discard"};
267 "id",
"space_id",
"table_id",
"root",
"trx_id"};
366 const char *
encode(
const byte *stream,
size_t in_len,
size_t *out_len);
374 const byte *
decode(
const char *stream,
size_t in_len,
size_t *out_len);
385#ifndef UNIV_HOTBACKUP
417 const TABLE *
table,
const size_t max_part_len,
418 std::function<
void(
const KEY &)> visitor);
424 if (
table.is_temporary()) {
428 return (
table.se_private_data().exists(
436 if (
table.is_temporary()) {
440 for (
const auto column :
table.columns()) {
453 if (
table.is_temporary()) {
457 for (
const auto column :
table.columns()) {
467 ut_ad(col_name !=
nullptr);
468 return (strncmp(col_name,
"DB_ROW_ID", 9) == 0 ||
469 strncmp(col_name,
"DB_TRX_ID", 9) == 0 ||
470 strncmp(col_name,
"DB_ROLL_PTR", 11) == 0);
480 uint32_t &c_c, uint32_t &t_c,
481 uint32_t ¤t_row_version) {
482 size_t n_dropped_cols = 0;
483 size_t n_added_cols = 0;
484 size_t n_added_and_dropped_cols = 0;
485 size_t n_current_cols = 0;
487 for (
const auto column :
table.columns()) {
495 n_added_and_dropped_cols++;
500 current_row_version = std::max(current_row_version, v_dropped);
510 current_row_version = std::max(current_row_version, v_added);
516 ut_ad(n_dropped_cols >= n_added_and_dropped_cols);
517 size_t n_orig_dropped_cols = n_dropped_cols - n_added_and_dropped_cols;
518 c_c = n_current_cols;
519 i_c = (n_current_cols - n_added_cols) + n_orig_dropped_cols;
520 t_c = n_current_cols + n_dropped_cols;
527 if (
table.is_temporary()) {
531 bool has_row_version =
false;
532 for (
const auto column :
table.columns()) {
533 if (column->is_virtual()) {
539 if (column->se_private_data().exists(
541 has_row_version =
true;
549 if (has_row_version) {
550 bool found_inst_add_or_drop_col =
false;
551 for (
const auto column :
table.columns()) {
553 found_inst_add_or_drop_col =
true;
557 ut_ad(found_inst_add_or_drop_col);
561 return has_row_version;
568 if (
table.is_temporary()) {
575 bool instant = instant_v1 || instant_v2;
605 for (
auto part :
table.leaf_partitions()) {
625 bool is_discarded =
false;
649 bool is_discarded =
false;
650 if (partition_private.
exists(
677template <
typename Table,
typename Index>
679 return (*
table->indexes().begin());
687 return (dd_first<dd::Table, dd::Index>(
table));
696 return (dd_first<dd::Partition, dd::Partition_index>(partition));
715 return (
table.tablespace_id());
753template <
typename Table>
852template <
typename Table>
860template <
typename Table>
890template <typename Index>
929 const
dd::Table *dd_table,
930 const
char **col_names,
948 mtr_t *mtr, const
char *system_table_name,
986 char **col_name,
ulint *nth_v_col,
1054 uint64_t *autoextend_size,
1064template <typename Table>
1066 bool dict_mutex_own);
1074template <typename Table>
1076 bool dict_mutex_own);
1101 const
char *tbl_name, const
char **col_names,
1103 THD *thd,
bool dict_locked,
bool check_charsets,
1117 const
char *tbl_name, const
char **col_names,
1133 const
dd::Table *dd_table, const
char *
name,
1154 const
dd::Table &dd_table,
1155 const
dd::Partition *dd_part, const
char *tbl_name,
1172 bool check_corruption);
1182#ifndef UNIV_HOTBACKUP
1203 const char *
name,
bool dict_locked,
1237template <typename Table>
1240 const Table *dd_table,
THD *thd);
1259 const
char *new_space_name, const
char *new_path);
1279 const
char *dd_space_name,
space_id_t space_id,
1295 const
char *
filename,
bool discarded,
1306 uint64_t *autoextend_size);
1344 const
dd::Column *column);
1353 const
dd::Column *column);
1379 ut_ad(dd_space->files().size() == 1);
1380 return ((*dd_space->files().begin())->filename().c_str());
1389template <
typename Table>
1552 uint32_t current_row_version);
1560 const char *algorithm,
1586#ifndef UNIV_HOTBACKUP
1594 IF_DEBUG(, uint32_t ¤t_row_version),
1603 std::string &new_name);
1610 const char *column_name);
1620 const Field *field,
unsigned &col_len,
ulint &mtype,
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:48
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Class describing changes to be done by ALTER TABLE.
Definition: handler.h:3365
Class to decode or encode a stream of default value for instant table.
Definition: dict0dd.h:352
const byte * decode(const char *stream, size_t in_len, size_t *out_len)
Decode the specified stream, which is encoded by encode()
Definition: dict0dd.cc:103
const char * encode(const byte *stream, size_t in_len, size_t *out_len)
Encode the specified stream in format of bytes into chars.
Definition: dict0dd.cc:82
DD_instant_col_val_coder()
Constructor.
Definition: dict0dd.h:355
~DD_instant_col_val_coder()
Destructor.
Definition: dict0dd.h:358
void cleanup()
Clean-up last result.
Definition: dict0dd.h:378
byte * m_result
The encoded or decoded stream.
Definition: dict0dd.h:382
A granted metadata lock.
Definition: mdl.h:986
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Data structure that contains the information about shared tablespaces.
Definition: fsp0space.h:47
Definition: partition_index.h:47
Definition: partition.h:51
virtual const Table & table() const =0
virtual const Properties & se_private_data() const =0
virtual const Partition * parent() const =0
The Properties class defines an interface for storing key=value pairs, where both key and value may b...
Definition: properties.h:74
virtual bool exists(const String_type &key) const =0
Check for the existence of a key=value pair given the key.
virtual bool get(const String_type &key, String_type *value) const =0
Get the string value for a given key.
virtual const Partition_leaf_vector & leaf_partitions() const =0
virtual enum_subpartition_type subpartition_type() const =0
@ PT_NONE
Definition: table.h:91
@ ST_NONE
Definition: table.h:107
Definition: tablespace.h:56
Definition: dictionary_client.h:149
Definition: sess0sess.h:71
A table definition from the master.
Definition: rpl_utility.h:249
const char * p
Definition: ctype-mb.cc:1225
dberr_t
Definition: db0err.h:39
void dd_clear_instant_part(dd::Partition &dd_part)
Clear the instant ADD COLUMN information of a partition, to make it as a normal partition.
Definition: dict0dd.cc:1910
bool dd_table_discard_tablespace(THD *thd, const dict_table_t *table, dd::Table *table_def, bool discard)
Set the discard flag for a non-partitioned dd table.
Definition: dict0dd.cc:863
void dd_set_table_options(Table *dd_table, const dict_table_t *table)
Set options of dd::Table according to InnoDB table object.
Definition: dict0dd.cc:2737
const char *const dd_table_key_strings[DD_TABLE__LAST]
InnoDB private key strings for dd::Table.
Definition: dict0dd.h:236
bool dd_create_implicit_tablespace(dd::cache::Dictionary_client *dd_client, space_id_t space_id, const char *space_name, const char *filename, bool discarded, dd::Object_id &dd_space_id)
Create metadata for implicit tablespace.
Definition: dict0dd.cc:4099
void dd_write_table(dd::Object_id dd_space_id, Table *dd_table, const dict_table_t *table)
Write metadata of a table to dd::Table.
Definition: dict0dd.cc:2637
void dd_tablespace_get_state(const dd::Tablespace *dd_space, dd::String_type *state, space_id_t space_id=SPACE_UNKNOWN)
Get state attribute value in dd::Tablespace::se_private_data.
Definition: dict0dd.cc:6929
dict_table_t * dd_open_table(dd::cache::Dictionary_client *client, const TABLE *table, const char *norm_name, const Table *dd_table, THD *thd)
Open or load a table definition based on a Global DD object.
Definition: dict0dd.cc:5423
bool dd_add_instant_columns(const dd::Table *old_dd_table, dd::Table *new_dd_table, dict_table_t *new_table, const Columns &cols_to_add)
Add column default values for new instantly added columns.
Definition: dict0dd.cc:2238
const char *const dd_space_state_values[DD_SPACE_STATE__LAST+1]
InnoDB private value strings for key string "state" in dd::Tablespace.
Definition: dict0dd.h:225
bool dd_column_is_added(const dd::Column *dd_col)
Determine if column is INSTANT ADD.
Definition: dict0dd.cc:134
bool dd_process_dd_indexes_rec_simple(mem_heap_t *heap, const rec_t *rec, space_index_t *index_id, space_id_t *space_id, dict_table_t *dd_indexes)
Process one mysql.indexes record and get brief info to dict_index_t.
Definition: dict0dd.cc:6108
bool dd_is_table_in_encrypted_tablespace(const dict_table_t *table)
Definition: dict0dd.cc:7285
bool dd_part_is_stored(const dd::Partition *part)
Determine if a partition is materialized.
Definition: dict0dd.h:703
bool dd_table_match(const dict_table_t *table, const Table *dd_table)
Check if the InnoDB table is consistent with dd::Table.
Definition: dict0dd.cc:245
static const char innobase_hton_name[]
Definition: dict0dd.h:78
static const char * dd_tablespace_get_filename(const dd::Tablespace *dd_space)
Get the file name of a tablespace.
Definition: dict0dd.h:1376
dberr_t dd_table_load_fk(dd::cache::Dictionary_client *client, const char *tbl_name, const char **col_names, dict_table_t *m_table, const dd::Table *dd_table, THD *thd, bool dict_locked, bool check_charsets, dict_names_t *fk_tables)
Load foreign key constraint for the table.
Definition: dict0dd.cc:4470
static bool create_table_check_doc_id_col(THD *thd, const TABLE *form, ulint *doc_id_col)
Check whether there exist a column named as "FTS_DOC_ID", which is reserved for InnoDB FTS Doc ID.
Definition: dict0dd.ic:214
bool dd_match_default_value(const dd::Column *dd_col, const dict_col_t *col)
Compare the default values between imported column and column defined in the server.
Definition: dict0dd.cc:2384
void dd_tablespace_set_discard(dd::Tablespace *dd_space, bool discard)
Set discard attribute value in se_private_dat of tablespace.
static const dd::String_type dd_tables_name("mysql/tables")
Table names needed to process I_S queries.
bool dd_tablespace_is_discarded(const dd::Tablespace *dd_space)
Get the discarded state from se_private_data of tablespace.
Definition: dict0dd.cc:7026
static const dd::Column * dd_find_column(const dd::Table *dd_table, const char *name)
Look up a column in a table using the system_charset_info collation.
Definition: dict0dd.ic:74
dict_table_t * dd_table_open_on_id(table_id_t table_id, THD *thd, MDL_ticket **mdl, bool dict_locked, bool check_corruption)
Open a persistent InnoDB table based on InnoDB table id, and hold Shared MDL lock on it.
Definition: dict0dd.cc:688
void dd_add_fts_doc_id_index(dd::Table &new_table, const dd::Table &old_table)
Add fts doc id column and index to new table when old table has hidden fts doc id without fulltext in...
Definition: dict0dd.cc:2842
dd_table_keys
InnoDB private keys for dd::Table.
Definition: dict0dd.h:102
@ DD_TABLE_DISCARD
Discard flag.
Definition: dict0dd.h:114
@ DD_TABLE_VERSION
Dynamic metadata version.
Definition: dict0dd.h:108
@ DD_TABLE_AUTOINC
Auto-increment counter.
Definition: dict0dd.h:104
@ DD_TABLE_INSTANT_COLS
Columns before first instant ADD COLUMN, used only for V1.
Definition: dict0dd.h:116
@ DD_TABLE_DATA_DIRECTORY
DATA DIRECTORY (static metadata)
Definition: dict0dd.h:106
@ DD_TABLE__LAST
Sentinel.
Definition: dict0dd.h:118
void dd_write_tablespace(dd::Tablespace *dd_space, space_id_t space_id, uint32_t fsp_flags, dd_space_states state)
Write metadata of a tablespace to dd::Tablespace.
Definition: dict0dd.cc:2827
std::vector< Field * > Columns
Definition: dict0dd.h:787
dberr_t dd_table_load_fk_from_dd(dict_table_t *m_table, const dd::Table *dd_table, const char **col_names, dict_err_ignore_t ignore_err, bool dict_locked)
Load foreign key constraint info for the dd::Table object.
Definition: dict0dd.cc:4301
bool dd_process_dd_indexes_rec(mem_heap_t *heap, const rec_t *rec, const dict_index_t **index, MDL_ticket **mdl, dict_table_t **parent, MDL_ticket **parent_mdl, dict_table_t *dd_indexes, mtr_t *mtr)
Process one mysql.indexes record and get the dict_index_t.
Definition: dict0dd.cc:5953
static void dd_add_hidden_element(dd::Index *index, const dd::Column *column)
Add a hidden index element at the end.
Definition: dict0dd.ic:121
bool dd_drop_fts_table(const char *name, bool file_per_table)
Drop dd table & tablespace for fts aux table.
Definition: dict0dd.cc:6725
uint32_t dd_get_total_indexes_num()
Definition: dict0dd.cc:7077
static constexpr char handler_name[]
Handler name for InnoDB.
Definition: dict0dd.h:76
bool dd_part_has_instant_cols(const dd::Partition &part)
Determine if a dd::Partition has any instant column.
Definition: dict0dd.h:587
int acquire_uncached_table(THD *thd, dd::cache::Dictionary_client *client, const dd::Table *dd_table, const char *name, TABLE_SHARE *ts, TABLE *td)
Open uncached table definition based on a Global DD object.
Definition: dict0dd.cc:328
bool dd_is_discarded(const dd::Table &table)
Determine if dd::Table is discarded.
Definition: dict0dd.h:623
dict_table_t * dd_table_open_on_name(THD *thd, MDL_ticket **mdl, const char *name, bool dict_locked, ulint ignore_err, int *error=nullptr)
Open an internal handle to a persistent InnoDB table by name.
Definition: dict0dd.cc:933
static dict_table_t * dd_table_open_on_name_in_mem(const char *name, bool dict_locked)
Returns a cached table object based on table name.
Definition: dict0dd.ic:177
dd_index_keys
InnoDB private keys for dd::Index or dd::Partition_index.
Definition: dict0dd.h:249
@ DD_INDEX_ID
Index identifier.
Definition: dict0dd.h:251
@ DD_INDEX_TRX_ID
Creating transaction ID.
Definition: dict0dd.h:259
@ DD_INDEX_ROOT
Root page number.
Definition: dict0dd.h:257
@ DD_TABLE_ID
Table id.
Definition: dict0dd.h:255
@ DD_INDEX_SPACE_ID
Space id.
Definition: dict0dd.h:253
@ DD_INDEX__LAST
Sentinel.
Definition: dict0dd.h:261
static constexpr char reserved_implicit_name[]
InnoDB implicit tablespace name or prefix, which should be same to dict_sys_t::s_file_per_table_name.
Definition: dict0dd.h:216
bool dd_set_tablespace_compression(dd::cache::Dictionary_client *client, const char *algorithm, dd::Object_id dd_space_id)
Set Innodb tablespace compression option from DD.
Definition: dict0dd.cc:4274
void dd_tablespace_set_state(THD *thd, dd::Object_id dd_space_id, std::string space_name, dd_space_states state)
Set the 'state' value in dd:tablespace::se_private_data starting with an object id and the space name...
Definition: dict0dd.cc:6851
const char * dd_process_dd_partitions_rec_and_mtr_commit(mem_heap_t *heap, const rec_t *rec, dict_table_t **table, dict_table_t *dd_tables, MDL_ticket **mdl, mtr_t *mtr)
Process one mysql.table_partitions record and get the dict_table_t.
Definition: dict0dd.cc:5599
bool dd_tablespace_get_discard(const dd::Tablespace *dd_space)
Get discard attribute value stored in se_private_dat of tablespace.
void dd_import_instant_add_columns(const dict_table_t *table, dd::Table *dd_table)
Import all metadata which is related to instant ADD COLUMN of a table to dd::Table.
Definition: dict0dd.cc:2500
bool dd_is_valid_row_version(uint32_t version)
Determine if give version is a valid row version.
Definition: dict0dd.cc:129
const dict_index_t * dd_find_index(const dict_table_t *table, Index *dd_index)
Find the specified dd::Index or dd::Partition_index in an InnoDB table.
Definition: dict0dd.cc:2874
dd_partition_keys
InnoDB private keys for dd::Partition.
Definition: dict0dd.h:155
@ DD_PARTITION_INSTANT_COLS
Columns before first instant ADD COLUMN.
Definition: dict0dd.h:163
@ DD_PARTITION__LAST
Sentinel.
Definition: dict0dd.h:171
@ DD_PARTITION_ROW_FORMAT
Row format for this partition.
Definition: dict0dd.h:157
@ DD_PARTITION_DISCARD
Discard flag.
Definition: dict0dd.h:169
bool dd_get_tablespace_size_option(dd::cache::Dictionary_client *dd_client, const dd::Object_id dd_space_id, uint64_t *autoextend_size)
Get the autoextend_size attribute for a tablespace.
Definition: dict0dd.cc:4170
const uint32_t DD_SPACE_CURRENT_SPACE_VERSION
The tablespace version that the tablespace created.
Definition: dict0dd.h:151
void dd_release_mdl(MDL_ticket *mdl_ticket)
Release the MDL held by the given ticket.
Definition: dict0dd.cc:7070
dd_space_states dd_tablespace_get_state_enum_legacy(const dd::Properties *p, space_id_t space_id=SPACE_UNKNOWN)
Get the enum for the state of a tablespace.
Definition: dict0dd.cc:6977
const innodb_dd_table_t innodb_dd_table[]
The hard-coded data dictionary tables.
Definition: dict0dd.h:296
bool dd_create_fts_index_table(const dict_table_t *parent_table, dict_table_t *table, const CHARSET_INFO *charset)
Create dd table for fts aux index table.
Definition: dict0dd.cc:6440
static const dd::String_type dd_partitions_name("mysql/table_partitions")
constexpr uint32_t DICT_MAX_DD_TABLES
Maximum hardcoded data dictionary tables.
Definition: dict0dd.h:99
void dd_copy_table_columns(const Alter_inplace_info *ha_alter_info, dd::Table &new_table, const dd::Table &old_table, dict_table_t *dict_table)
Copy the engine-private parts of column definitions of a table.
Definition: dict0dd.cc:1782
static const dd::String_type index_file_name_key("index_file_name")
dd::Partition::options() key for INDEX DIRECTORY
const dd::Index * dd_first_index(const dd::Table *table)
Get the first index of a table.
Definition: dict0dd.h:686
static constexpr char autoextend_size_str[]
String constant for AUTOEXTEND_SIZE option string.
Definition: dict0dd.h:81
bool dd_process_dd_columns_rec(mem_heap_t *heap, const rec_t *rec, dict_col_t *col, table_id_t *table_id, char **col_name, ulint *nth_v_col, const dict_table_t *dd_columns, mtr_t *mtr)
Process one mysql.columns record and get info to dict_col_t.
Definition: dict0dd.cc:5674
innodb_session_t *& thd_to_innodb_session(THD *thd)
Obtain the private handler of InnoDB session specific data.
Definition: ha_innodb.cc:2010
constexpr bool DD_FAILURE
Definition: dict0dd.h:73
void dd_copy_instant_n_cols(dd::Table &new_table, const dd::Table &old_table)
Copy the metadata of a table definition if there was an instant ADD COLUMN happened.
Definition: dict0dd.cc:1670
bool is_dropped(const Alter_inplace_info *ha_alter_info, const char *column_name)
Check if given column is dropped during ALTER.
Definition: dict0dd.cc:1769
bool dd_implicit_alter_tablespace(dd::cache::Dictionary_client *dd_client, dd::Object_id dd_space_id, HA_CREATE_INFO *create_info)
Set the autoextend_size attribute for an implicit tablespace.
Definition: dict0dd.cc:4198
const char *const dd_space_key_strings[DD_SPACE__LAST]
InnoDB private key strings for dd::Tablespace.
Definition: dict0dd.h:220
void dd_set_autoinc(dd::Properties &se_private_data, uint64_t autoinc)
Set the AUTO_INCREMENT attribute.
Definition: dict0dd.cc:1611
static constexpr size_t innodb_dd_table_size
Number of hard-coded data dictionary tables.
Definition: dict0dd.h:335
dd_space_keys
InnoDB private keys for dd::Tablespace.
Definition: dict0dd.h:175
@ DD_SPACE_STATE
Current state attribute.
Definition: dict0dd.h:187
@ DD_SPACE_DISCARD
Discard attribute.
Definition: dict0dd.h:181
@ DD_SPACE_SERVER_VERSION
Server version.
Definition: dict0dd.h:183
@ DD_SPACE__LAST
Sentinel.
Definition: dict0dd.h:189
@ DD_SPACE_VERSION
TABLESPACE_VERSION.
Definition: dict0dd.h:185
@ DD_SPACE_FLAGS
Tablespace flags.
Definition: dict0dd.h:177
@ DD_SPACE_ID
Tablespace identifier.
Definition: dict0dd.h:179
char * dd_get_referenced_table(const char *name, const char *database_name, ulint database_name_len, const char *table_name, ulint table_name_len, dict_table_t **table, MDL_ticket **mdl, mem_heap_t *heap)
Open a table from its database and table name, this is currently used by foreign constraint parser to...
Definition: dict0dd.cc:7098
bool dd_tablespace_get_mdl(const char *space_name, MDL_ticket **mdl_ticket=nullptr, bool foreground=true)
Get the MDL for the named tablespace.
Definition: dict0dd.cc:7038
bool dd_table_has_instant_cols(const dd::Table &table)
Determine if a dd::Table has any INSTANTly ADDed/DROPped column.
Definition: dict0dd.h:567
bool dd_column_is_dropped(const dd::Column *dd_col)
Determine if column is INSTANT DROP.
Definition: dict0dd.cc:149
bool dd_table_has_row_versions(const dd::Table &table)
Determine if a dd::Table has row versions.
Definition: dict0dd.h:526
static dict_table_t * dd_table_open_on_id_in_mem(table_id_t table_id, bool dict_locked)
Returns a cached table object based on table id.
Definition: dict0dd.ic:143
bool dd_drop_instant_columns(const dd::Table *old_dd_table, dd::Table *new_dd_table, dict_table_t *new_table, const Columns &cols_to_drop, const Columns &cols_to_add, Alter_inplace_info *ha_alter_info)
Drop column instantly.
Definition: dict0dd.cc:2111
void dd_get_and_save_space_name(dict_table_t *table, const Table *dd_table, bool dict_mutex_own)
Make sure the tablespace name is saved in dict_table_t if the table uses a general tablespace.
Definition: dict0dd.cc:4980
void dd_copy_private(Table &new_table, const Table &old_table)
Copy the engine-private parts of a table or partition definition when the change does not affect Inno...
Definition: dict0dd.cc:1693
dberr_t dd_clear_instant_table(dd::Table &dd_table, bool clear_version)
Clear the instant ADD COLUMN information of a table.
Definition: dict0dd.cc:1852
dd_column_keys
InnoDB private keys for dd::Column.
Definition: dict0dd.h:130
@ DD_COLUMN__LAST
Sentinel.
Definition: dict0dd.h:142
@ DD_INSTANT_COLUMN_DEFAULT
Default value when it was added instantly.
Definition: dict0dd.h:132
@ DD_INSTANT_PHYSICAL_POS
Column physical position on row when it was created.
Definition: dict0dd.h:140
@ DD_INSTANT_VERSION_DROPPED
Row version when this column was dropped instantly.
Definition: dict0dd.h:138
@ DD_INSTANT_COLUMN_DEFAULT_NULL
Default value is null or not.
Definition: dict0dd.h:134
@ DD_INSTANT_VERSION_ADDED
Row version when this column was added instantly.
Definition: dict0dd.h:136
void dd_table_get_column_counters(const dd::Table &table, uint32_t &i_c, uint32_t &c_c, uint32_t &t_c, uint32_t ¤t_row_version)
Set different column counters.
Definition: dict0dd.h:479
dberr_t dd_update_table_and_partitions_after_dir_change(dd::Object_id object_id, std::string path)
Update the data directory flag in dd::Table key strings.
Definition: dict0dd.cc:1143
bool dd_table_is_partitioned(const dd::Table &table)
Determine if a dd::Table is partitioned table.
Definition: dict0dd.h:398
uint32_t dd_column_get_version_added(const dd::Column *dd_col)
Get the row version in which column is INSTANT ADD.
Definition: dict0dd.cc:164
const char *const dd_partition_key_strings[DD_PARTITION__LAST]
InnoDB private key strings for dd::Partition.
Definition: dict0dd.h:245
dd_space_states
Values for InnoDB private key "state" for dd::Tablespace.
Definition: dict0dd.h:193
@ DD_SPACE_STATE_DISCARDED
Discarded IBD tablespace.
Definition: dict0dd.h:197
@ DD_SPACE_STATE_ACTIVE
Active undo tablespace.
Definition: dict0dd.h:201
@ DD_SPACE_STATE_CORRUPTED
Corrupted IBD tablespace.
Definition: dict0dd.h:199
@ DD_SPACE_STATE_EMPTY
Inactive undo tablespace being truncated, selected explicitly by ALTER UNDO TABLESPACE SET INACTIVE.
Definition: dict0dd.h:209
@ DD_SPACE_STATE_NORMAL
Normal IBD tablespace.
Definition: dict0dd.h:195
@ DD_SPACE_STATE_INACTIVE
Inactive undo tablespace being truncated, selected explicitly by ALTER UNDO TABLESPACE SET INACTIVE.
Definition: dict0dd.h:206
@ DD_SPACE_STATE__LAST
Sentinel.
Definition: dict0dd.h:211
const char *const dd_index_key_strings[DD_INDEX__LAST]
InnoDB private key strings for dd::Index or dd::Partition_index.
Definition: dict0dd.h:266
constexpr bool DD_SUCCESS
DD functions return false for success and true for failure because that is the way the server functio...
Definition: dict0dd.h:72
dberr_t dd_tablespace_rename(dd::Object_id dd_space_id, bool is_system_cs, const char *new_space_name, const char *new_path)
Update the tablespace name and file name for rename operation.
Definition: dict0dd.cc:1259
static const dd::String_type dd_indexes_name("mysql/indexes")
bool dd_drop_tablespace(dd::cache::Dictionary_client *dd_client, dd::Object_id dd_space_id)
Drop a tablespace.
Definition: dict0dd.cc:4115
const uint32_t DD_SPACE_CURRENT_SRV_VERSION
Server version that the tablespace created.
Definition: dict0dd.h:148
void dd_copy_autoinc(const dd::Properties &src, dd::Properties &dest)
Copy the AUTO_INCREMENT and version attribute if exist.
Definition: dict0dd.cc:1645
bool dd_process_dd_virtual_columns_rec(mem_heap_t *heap, const rec_t *rec, table_id_t *table_id, ulint **pos, ulint **base_pos, ulint *n_row, dict_table_t *dd_columns, mtr_t *mtr)
Process one mysql.columns record for virtual columns.
Definition: dict0dd.cc:5831
const char *const dd_column_key_strings[DD_COLUMN__LAST]
InnoDB private key strings for dd::Column,.
Definition: dict0dd.h:240
bool dd_create_fts_common_table(const dict_table_t *parent_table, dict_table_t *table, bool is_config)
Create dd table for fts aux common table.
Definition: dict0dd.cc:6586
bool copy_dropped_columns(const dd::Table *old_dd_table, dd::Table *new_dd_table, uint32_t current_row_version)
Copy metadata of already dropped columns from old table def to new table def.
Definition: dict0dd.cc:2013
uint32_t dd_column_get_version_dropped(const dd::Column *dd_col)
Get the row version in which column is INSTANT DROP.
Definition: dict0dd.cc:176
bool dd_table_has_instant_add_cols(const dd::Table &table)
Determine if dd::Table has INSTANT ADD columns.
Definition: dict0dd.h:435
void dd_get_and_save_data_dir_path(dict_table_t *table, const Table *dd_table, bool dict_mutex_own)
Make sure the data_dir_path is saved in dict_table_t if DATA DIRECTORY was used.
Definition: dict0dd.cc:4707
void dd_open_fk_tables(dict_names_t &fk_list, bool dict_locked, THD *thd)
Open foreign tables reference a table.
Definition: dict0dd.cc:5392
void dd_visit_keys_with_too_long_parts(const TABLE *table, const size_t max_part_len, std::function< void(const KEY &)> visitor)
Scan through all the keys to identify the key parts which are greater than the maximum size supported...
Definition: dict0dd.cc:1986
bool dd_table_is_upgraded_instant(const dd::Table &table)
Determine if a dd::Table has any INSTANT ADD column(s) in V1.
Definition: dict0dd.h:423
void dd_set_discarded(dd::Table &table, bool discard)
Sets appropriate discard attribute of dd::Table Please note that this function must not be called on ...
Definition: dict0dd.cc:6906
bool dd_tablespace_set_id_and_state(const char *space_name, space_id_t space_id, dd_space_states state)
Set Space ID and state attribute in se_private_data of mysql.tablespaces for the named tablespace.
Definition: dict0dd.cc:6885
void dd_write_default_value(const dict_col_t *col, dd::Column *dd_col)
Write default value of a column to dd::Column.
Definition: dict0dd.cc:2415
bool is_renamed(const Alter_inplace_info *ha_alter_info, const char *old_name, std::string &new_name)
Check if given column is renamed during ALTER.
Definition: dict0dd.cc:1751
void dd_table_close(dict_table_t *table, THD *thd, MDL_ticket **mdl, bool dict_locked)
Close an internal InnoDB table handle.
Definition: dict0dd.cc:1082
void dd_update_v_cols(dd::Table *dd_table, table_id_t id)
Update virtual columns with new se_private_data, currently, only table_id is set.
Definition: dict0dd.cc:2798
const rec_t * dd_startscan_system(THD *thd, MDL_ticket **mdl, btr_pcur_t *pcur, mtr_t *mtr, const char *system_table_name, dict_table_t **table)
Scan a new dd system table, like mysql.tables...
Definition: dict0dd.cc:5495
const rec_t * dd_getnext_system_rec(btr_pcur_t *pcur, mtr_t *mtr)
Get next record of new DD system tables.
Definition: dict0dd.cc:5480
bool dd_table_has_instant_drop_cols(const dd::Table &table)
Determine if dd::Table has INSTANT DROPPED columns.
Definition: dict0dd.h:452
uint64_t dd_get_version(const dd::Table *dd_table)
Get the version attribute.
Definition: dict0dd.ic:333
dd_space_states dd_tablespace_get_state_enum(const dd::Tablespace *dd_space, space_id_t space_id=SPACE_UNKNOWN)
Get the enum for the state of the undo tablespace from either dd::Tablespace::se_private_data or undo...
Definition: dict0dd.cc:6949
bool dd_instant_columns_consistent(const dd::Table &dd_table)
Check if the instant columns are consistent with the se_private_data in dd::Table.
Definition: dict0dd.cc:1918
const Index * dd_first(const Table *table)
Get the first index of a table or partition.
Definition: dict0dd.h:678
bool dd_tablespace_update_cache(THD *thd)
Update all InnoDB tablespace cache objects.
Definition: dict0dd.cc:7163
void get_field_types(const dd::Table *dd_tab, const dict_table_t *m_table, const Field *field, unsigned &col_len, ulint &mtype, ulint &prtype)
Get the mtype, prtype and len for a field.
Definition: dict0dd.cc:3519
bool dd_part_is_first(const dd::Partition *dd_part)
Determine if a dd::Partition is the first leaf partition in the table.
Definition: dict0dd.h:390
static const dd::String_type dd_tablespaces_name("mysql/tablespaces")
static bool dd_mdl_acquire(THD *thd, MDL_ticket **mdl, const char *db, const char *table)
Acquire a shared metadata lock.
bool dd_rename_fts_table(const dict_table_t *table, const char *old_name)
Rename dd table & tablespace files for fts aux table.
Definition: dict0dd.cc:6778
bool dd_table_part_has_instant_cols(const dd::Table &table)
Determine if any partition of the table still has instant columns.
Definition: dict0dd.h:599
static const char * get_row_format_name(enum row_type row_format)
Return a display name for the row format.
Definition: dict0dd.ic:256
dberr_t dd_table_check_for_child(dd::cache::Dictionary_client *client, const char *tbl_name, const char **col_names, dict_table_t *m_table, bool check_charsets, dict_err_ignore_t ignore_err, dict_names_t *fk_tables)
Load foreign key constraint for the table.
Definition: dict0dd.cc:4510
bool dd_process_dd_tablespaces_rec(mem_heap_t *heap, const rec_t *rec, space_id_t *space_id, char **name, uint32_t *flags, uint32_t *server_version, uint32_t *space_version, bool *is_encrypted, uint64_t *autoextend_size, dd::String_type *state, dict_table_t *dd_spaces)
Process one mysql.tablespaces record and get info.
Definition: dict0dd.cc:6171
void release_uncached_table(TABLE_SHARE *ts, TABLE *td)
free uncached table definition.
Definition: dict0dd.cc:365
const char * dd_process_dd_tables_rec_and_mtr_commit(mem_heap_t *heap, const rec_t *rec, dict_table_t **table, dict_table_t *dd_tables, MDL_ticket **mdl, mtr_t *mtr)
Process one mysql.tables record and get the dict_table_t.
Definition: dict0dd.cc:5529
void fill_dict_dropped_columns(const dd::Table *dd_table, dict_table_t *dict_table, uint32_t ¤t_row_version, mem_heap_t *heap)
Add definition of INSTANT dropped column in table cache.
Definition: dict0dd.cc:3676
int dd_table_open_on_dd_obj(THD *thd, dd::cache::Dictionary_client *client, const dd::Table &dd_table, const dd::Partition *dd_part, const char *tbl_name, dict_table_t *&table, const TABLE *td)
Instantiate an InnoDB in-memory table metadata (dict_table_t) based on a Global DD object or MYSQL ta...
Definition: dict0dd.cc:370
void dd_parse_default_value(const dd::Properties &se_private_data, dict_col_t *col, mem_heap_t *heap)
Parse the default value from dd::Column::se_private to dict_col_t.
Definition: dict0dd.cc:2436
void dd_get_meta_data_filename(dict_table_t *table, dd::Table *dd_table, char *filename, ulint max_len)
Get the meta-data filename from the table name for a single-table tablespace.
Definition: dict0dd.cc:4759
void dd_mdl_release(THD *thd, MDL_ticket **mdl)
Release a metadata lock.
Definition: dict0dd.cc:294
void dd_copy_table(const Alter_inplace_info *ha_alter_info, dd::Table &new_table, const dd::Table &old_table)
Copy the metadata of a table definition, including the INSTANT ADD COLUMN information.
Definition: dict0dd.h:772
bool dd_mdl_for_undo(const trx_t &trx)
Check if current undo needs a MDL or not.
Definition: dict0dd.cc:310
static dd::Column * dd_add_hidden_column(dd::Table *dd_table, const char *name, uint length, dd::enum_column_types type)
Add a hidden column when creating a table.
Definition: dict0dd.ic:90
static const dd::String_type dd_columns_name("mysql/columns")
bool dd_create_tablespace(dd::cache::Dictionary_client *dd_client, const char *dd_space_name, space_id_t space_id, uint32_t flags, const char *filename, bool discarded, dd::Object_id &dd_space_id)
Create metadata for specified tablespace, acquiring exclusive MDL first.
Definition: dict0dd.cc:4041
dd::Object_id dd_get_space_id(const dd::Table &table)
Get the explicit dd::Tablespace::id of a table.
Definition: dict0dd.h:713
void dd_part_adjust_table_id(dd::Table *new_table)
Adjust TABLE_ID for partitioned table after ALTER TABLE ... PARTITION.
Definition: dict0dd.cc:1836
static bool is_system_column(const char *col_name)
Definition: dict0dd.h:466
THD * dd_thd_for_undo(const trx_t &trx)
Returns thd associated with the trx or current_thd.
Definition: dict0dd.cc:303
static dd::Index * dd_set_hidden_unique_index(dd::Index *index, const char *name, const dd::Column *column)
Initialize a hidden unique B-tree index.
Definition: dict0dd.ic:132
static const dd::String_type data_file_name_key("data_file_name")
dd::Partition::options() key for DATA DIRECTORY
std::deque< const char *, ut::allocator< const char * > > dict_names_t
A stack of table names related through foreign key constraints.
Definition: dict0load.h:50
Data dictionary memory object creation.
Data dictionary global types.
ib_id_t space_index_t
Index identifier (unique within a tablespace).
Definition: dict0types.h:234
dict_err_ignore_t
Error to ignore when we load table dictionary into memory.
Definition: dict0types.h:294
ib_id_t table_id_t
Table or partition identifier (unique within an InnoDB instance).
Definition: dict0types.h:232
constexpr space_id_t SPACE_UNKNOWN
Unknown space id.
Definition: fil0fil.h:1162
static int flags[50]
Definition: hp_test1.cc:40
Header for compiler-dependent features.
#define MY_COMPILER_DIAGNOSTIC_PUSH()
save the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:277
#define MY_COMPILER_DIAGNOSTIC_POP()
restore the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:278
#define MY_COMPILER_CLANG_WORKAROUND_TPARAM_DOCBUG()
ignore -Wdocumentation compiler warnings for @tparam.
Definition: my_compiler.h:300
static char * server_version
Definition: mysql.cc:118
Common definition between mysql server & client.
#define MYSQL_VERSION_ID
Definition: mysql_version.h:15
void error(const char *format,...)
static char * path
Definition: mysqldump.cc:149
std::string HARNESS_EXPORT foreground(Color c)
get 'change foreground color' ESC sequence.
Definition: vt100.cc:133
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
const std::string charset("charset")
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
unsigned long long Object_id
Definition: object_id.h:31
const Object_id INVALID_OBJECT_ID
The default object ID which represents that the DD object is new and not persistent in dictionary tab...
Definition: object_id.h:37
enum_column_types
Definition: column.h:53
bool is_encrypted(const String_type &type)
Definition: dd_table.h:422
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
const char * table_name
Definition: rules_table_service.cc:56
Definition: gcs_xcom_synode.h:64
void delete_arr(T *ptr) noexcept
Releases storage which has been dynamically allocated through any of the ut::new_arr*() variants.
Definition: ut0new.h:1111
const char * filename
Definition: pfs_example_component_population.cc:67
byte rec_t
Definition: rem0types.h:41
required uint64 version
Definition: replication_group_member_actions.proto:41
required string type
Definition: replication_group_member_actions.proto:34
InnoDB session state tracker.
row_type
Definition: handler.h:684
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:421
Struct to hold information about the table that should be created.
Definition: handler.h:3210
This structure is shared between different table objects.
Definition: table.h:704
Definition: btr0pcur.h:99
Data structure for a column in a table.
Definition: dict0mem.h:484
Data structure for an index.
Definition: dict0mem.h:1041
Data structure for a database table.
Definition: dict0mem.h:1904
Hard-coded data dictionary information.
Definition: dict0dd.h:288
const char * name
Data dictionary table name.
Definition: dict0dd.h:290
const uint n_indexes
Number of indexes.
Definition: dict0dd.h:292
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:177
Definition: trx0trx.h:675
Version control for database, common definitions, and include files.
#define IF_DEBUG(...)
Definition: univ.i:674
unsigned long int ulint
Definition: univ.i:406
#define INNODB_DD_TABLE(name, n_indexes)
Hard-coded data dictionary entry.
Definition: univ.i:646
#define UT_ARR_SIZE(a)
Definition: univ.i:524
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105
static int is_config(cargo_type x)
Definition: xcom_base.cc:2162