151#ifndef UNIV_HOTBACKUP
219 "flags",
"id",
"discard",
"server_version",
"space_version",
"state"};
235 "autoinc",
"data_directory",
"version",
"discard",
"instant_col"};
239 "default",
"default_null",
"version_added",
"version_dropped",
244 "format",
"instant_col",
"discard"};
265 "id",
"space_id",
"table_id",
"root",
"trx_id"};
364 const char *
encode(
const byte *stream,
size_t in_len,
size_t *out_len);
372 const byte *
decode(
const char *stream,
size_t in_len,
size_t *out_len);
383#ifndef UNIV_HOTBACKUP
415 const TABLE *table,
const size_t max_part_len,
416 std::function<
void(
const KEY &)> visitor);
438 for (
const auto column : table.
columns()) {
455 for (
const auto column : table.
columns()) {
465 ut_ad(col_name !=
nullptr);
466 return (strncmp(col_name,
"DB_ROW_ID", 9) == 0 ||
467 strncmp(col_name,
"DB_TRX_ID", 9) == 0 ||
468 strncmp(col_name,
"DB_ROLL_PTR", 11) == 0);
478 uint32_t &c_c, uint32_t &t_c,
479 uint32_t ¤t_row_version) {
480 size_t n_dropped_cols = 0;
481 size_t n_added_cols = 0;
482 size_t n_added_and_dropped_cols = 0;
483 size_t n_current_cols = 0;
485 for (
const auto column : table.
columns()) {
493 n_added_and_dropped_cols++;
498 current_row_version = std::max(current_row_version, v_dropped);
508 current_row_version = std::max(current_row_version, v_added);
514 ut_ad(n_dropped_cols >= n_added_and_dropped_cols);
515 size_t n_orig_dropped_cols = n_dropped_cols - n_added_and_dropped_cols;
516 c_c = n_current_cols;
517 i_c = (n_current_cols - n_added_cols) + n_orig_dropped_cols;
518 t_c = n_current_cols + n_dropped_cols;
529 bool has_row_version =
false;
530 for (
const auto column : table.
columns()) {
531 if (column->is_virtual()) {
537 if (column->se_private_data().exists(
539 has_row_version =
true;
547 if (has_row_version) {
548 bool found_inst_add_or_drop_col =
false;
549 for (
const auto column : table.
columns()) {
551 found_inst_add_or_drop_col =
true;
555 ut_ad(found_inst_add_or_drop_col);
559 return has_row_version;
573 bool instant = instant_v1 || instant_v2;
623 bool is_discarded =
false;
647 bool is_discarded =
false;
648 if (partition_private.
exists(
675template <
typename Table,
typename Index>
677 return (*table->indexes().begin());
685 return (dd_first<dd::Table, dd::Index>(table));
694 return (dd_first<dd::Partition, dd::Partition_index>(partition));
751template <
typename Table>
850template <
typename Table>
858template <
typename Table>
888template <typename Index>
927 const
dd::Table *dd_table,
928 const
char **col_names,
946 mtr_t *mtr, const
char *system_table_name,
984 char **col_name,
ulint *nth_v_col,
1052 uint64_t *autoextend_size,
1062template <typename Table>
1064 bool dict_mutex_own);
1072template <typename Table>
1074 bool dict_mutex_own);
1099 const
char *tbl_name, const
char **col_names,
1101 THD *thd,
bool dict_locked,
bool check_charsets,
1115 const
char *tbl_name, const
char **col_names,
1131 const
dd::Table *dd_table, const
char *
name,
1152 const
dd::Table &dd_table,
1153 const
dd::Partition *dd_part, const
char *tbl_name,
1170 bool check_corruption);
1180#ifndef UNIV_HOTBACKUP
1201 const char *
name,
bool dict_locked,
1235template <typename Table>
1237 const
TABLE *table, const
char *norm_name,
1238 const Table *dd_table,
THD *thd);
1257 const
char *new_space_name, const
char *new_path);
1277 const
char *dd_space_name,
space_id_t space_id,
1293 const
char *
filename,
bool discarded,
1304 uint64_t *autoextend_size);
1342 const
dd::Column *column);
1351 const
dd::Column *column);
1377 ut_ad(dd_space->files().size() == 1);
1378 return ((*dd_space->files().begin())->filename().c_str());
1387template <
typename Table>
1550 uint32_t current_row_version);
1558 const char *algorithm,
1584#ifndef UNIV_HOTBACKUP
1592 IF_DEBUG(, uint32_t ¤t_row_version),
1601 std::string &new_name);
1608 const char *column_name);
1618 const Field *field,
unsigned &col_len,
ulint &mtype,
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:52
Class describing changes to be done by ALTER TABLE.
Definition: handler.h:3196
Class to decode or encode a stream of default value for instant table.
Definition: dict0dd.h:350
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:102
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:81
DD_instant_col_val_coder()
Constructor.
Definition: dict0dd.h:353
~DD_instant_col_val_coder()
Destructor.
Definition: dict0dd.h:356
void cleanup()
Clean-up last result.
Definition: dict0dd.h:376
byte * m_result
The encoded or decoded stream.
Definition: dict0dd.h:380
A granted metadata lock.
Definition: mdl.h:984
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Data structure that contains the information about shared tablespaces.
Definition: fsp0space.h:47
virtual const Column_collection & columns() const =0
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 bool is_temporary() const =0
virtual enum_partition_type partition_type() const =0
virtual Object_id tablespace_id() const =0
virtual const Properties & se_private_data() 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:55
Definition: dictionary_client.h:149
Definition: sess0sess.h:71
A table definition from the master.
Definition: rpl_utility.h:248
const char * p
Definition: ctype-mb.cc:1237
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:1915
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:868
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:2742
const char *const dd_table_key_strings[DD_TABLE__LAST]
InnoDB private key strings for dd::Table.
Definition: dict0dd.h:234
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:4101
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:2642
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:6928
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:2243
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:223
bool dd_column_is_added(const dd::Column *dd_col)
Determine if column is INSTANT ADD.
Definition: dict0dd.cc:133
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:6107
bool dd_is_table_in_encrypted_tablespace(const dict_table_t *table)
Definition: dict0dd.cc:7284
bool dd_part_is_stored(const dd::Partition *part)
Determine if a partition is materialized.
Definition: dict0dd.h:701
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:250
static const char innobase_hton_name[]
Definition: dict0dd.h:76
static const char * dd_tablespace_get_filename(const dd::Tablespace *dd_space)
Get the file name of a tablespace.
Definition: dict0dd.h:1374
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:4472
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:2389
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:7025
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:693
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:2847
dd_table_keys
InnoDB private keys for dd::Table.
Definition: dict0dd.h:100
@ DD_TABLE_DISCARD
Discard flag.
Definition: dict0dd.h:112
@ DD_TABLE_VERSION
Dynamic metadata version.
Definition: dict0dd.h:106
@ DD_TABLE_AUTOINC
Auto-increment counter.
Definition: dict0dd.h:102
@ DD_TABLE_INSTANT_COLS
Columns before first instant ADD COLUMN, used only for V1.
Definition: dict0dd.h:114
@ DD_TABLE_DATA_DIRECTORY
DATA DIRECTORY (static metadata)
Definition: dict0dd.h:104
@ DD_TABLE__LAST
Sentinel.
Definition: dict0dd.h:116
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:2832
std::vector< Field * > Columns
Definition: dict0dd.h:785
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:4303
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:5952
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:6724
uint32_t dd_get_total_indexes_num()
Definition: dict0dd.cc:7076
static constexpr char handler_name[]
Handler name for InnoDB.
Definition: dict0dd.h:74
bool dd_part_has_instant_cols(const dd::Partition &part)
Determine if a dd::Partition has any instant column.
Definition: dict0dd.h:585
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:333
bool dd_is_discarded(const dd::Table &table)
Determine if dd::Table is discarded.
Definition: dict0dd.h:621
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:938
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:247
@ DD_INDEX_ID
Index identifier.
Definition: dict0dd.h:249
@ DD_INDEX_TRX_ID
Creating transaction ID.
Definition: dict0dd.h:257
@ DD_INDEX_ROOT
Root page number.
Definition: dict0dd.h:255
@ DD_TABLE_ID
Table id.
Definition: dict0dd.h:253
@ DD_INDEX_SPACE_ID
Space id.
Definition: dict0dd.h:251
@ DD_INDEX__LAST
Sentinel.
Definition: dict0dd.h:259
THD * dd_thd_for_undo(const trx_t *trx)
Returns thd associated with the trx or current_thd.
Definition: dict0dd.cc:308
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:214
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:4276
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:6850
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:5598
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:2505
bool dd_is_valid_row_version(uint32_t version)
Determine if give version is a valid row version.
Definition: dict0dd.cc:128
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:2877
dd_partition_keys
InnoDB private keys for dd::Partition.
Definition: dict0dd.h:153
@ DD_PARTITION_INSTANT_COLS
Columns before first instant ADD COLUMN.
Definition: dict0dd.h:161
@ DD_PARTITION__LAST
Sentinel.
Definition: dict0dd.h:169
@ DD_PARTITION_ROW_FORMAT
Row format for this partition.
Definition: dict0dd.h:155
@ DD_PARTITION_DISCARD
Discard flag.
Definition: dict0dd.h:167
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:4172
const uint32_t DD_SPACE_CURRENT_SPACE_VERSION
The tablespace version that the tablespace created.
Definition: dict0dd.h:149
void dd_release_mdl(MDL_ticket *mdl_ticket)
Release the MDL held by the given ticket.
Definition: dict0dd.cc:7069
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:6976
const innodb_dd_table_t innodb_dd_table[]
The hard-coded data dictionary tables.
Definition: dict0dd.h:294
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:6439
static const dd::String_type dd_partitions_name("mysql/table_partitions")
bool dd_mdl_for_undo(const trx_t *trx)
Check if current undo needs a MDL or not.
Definition: dict0dd.cc:315
constexpr uint32_t DICT_MAX_DD_TABLES
Maximum hardcoded data dictionary tables.
Definition: dict0dd.h:97
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:1787
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:684
static constexpr char autoextend_size_str[]
String constant for AUTOEXTEND_SIZE option string.
Definition: dict0dd.h:79
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:5673
innodb_session_t *& thd_to_innodb_session(THD *thd)
Obtain the private handler of InnoDB session specific data.
Definition: ha_innodb.cc:2020
constexpr bool DD_FAILURE
Definition: dict0dd.h:71
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:1675
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:1774
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:4200
const char *const dd_space_key_strings[DD_SPACE__LAST]
InnoDB private key strings for dd::Tablespace.
Definition: dict0dd.h:218
void dd_set_autoinc(dd::Properties &se_private_data, uint64_t autoinc)
Set the AUTO_INCREMENT attribute.
Definition: dict0dd.cc:1616
static constexpr size_t innodb_dd_table_size
Number of hard-coded data dictionary tables.
Definition: dict0dd.h:333
dd_space_keys
InnoDB private keys for dd::Tablespace.
Definition: dict0dd.h:173
@ DD_SPACE_STATE
Current state attribute.
Definition: dict0dd.h:185
@ DD_SPACE_DISCARD
Discard attribute.
Definition: dict0dd.h:179
@ DD_SPACE_SERVER_VERSION
Server version.
Definition: dict0dd.h:181
@ DD_SPACE__LAST
Sentinel.
Definition: dict0dd.h:187
@ DD_SPACE_VERSION
TABLESPACE_VERSION.
Definition: dict0dd.h:183
@ DD_SPACE_FLAGS
Tablespace flags.
Definition: dict0dd.h:175
@ DD_SPACE_ID
Tablespace identifier.
Definition: dict0dd.h:177
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:7097
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:7037
bool dd_table_has_instant_cols(const dd::Table &table)
Determine if a dd::Table has any INSTANTly ADDed/DROPped column.
Definition: dict0dd.h:565
bool dd_column_is_dropped(const dd::Column *dd_col)
Determine if column is INSTANT DROP.
Definition: dict0dd.cc:148
bool dd_table_has_row_versions(const dd::Table &table)
Determine if a dd::Table has row versions.
Definition: dict0dd.h:524
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:2116
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:4982
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:1698
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:1857
dd_column_keys
InnoDB private keys for dd::Column.
Definition: dict0dd.h:128
@ DD_COLUMN__LAST
Sentinel.
Definition: dict0dd.h:140
@ DD_INSTANT_COLUMN_DEFAULT
Default value when it was added instantly.
Definition: dict0dd.h:130
@ DD_INSTANT_PHYSICAL_POS
Column physical position on row when it was created.
Definition: dict0dd.h:138
@ DD_INSTANT_VERSION_DROPPED
Row version when this column was dropped instantly.
Definition: dict0dd.h:136
@ DD_INSTANT_COLUMN_DEFAULT_NULL
Default value is null or not.
Definition: dict0dd.h:132
@ DD_INSTANT_VERSION_ADDED
Row version when this column was added instantly.
Definition: dict0dd.h:134
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:477
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:1148
bool dd_table_is_partitioned(const dd::Table &table)
Determine if a dd::Table is partitioned table.
Definition: dict0dd.h:396
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:163
const char *const dd_partition_key_strings[DD_PARTITION__LAST]
InnoDB private key strings for dd::Partition.
Definition: dict0dd.h:243
dd_space_states
Values for InnoDB private key "state" for dd::Tablespace.
Definition: dict0dd.h:191
@ DD_SPACE_STATE_DISCARDED
Discarded IBD tablespace.
Definition: dict0dd.h:195
@ DD_SPACE_STATE_ACTIVE
Active undo tablespace.
Definition: dict0dd.h:199
@ DD_SPACE_STATE_CORRUPTED
Corrupted IBD tablespace.
Definition: dict0dd.h:197
@ DD_SPACE_STATE_EMPTY
Inactive undo tablespace being truncated, selected explicitly by ALTER UNDO TABLESPACE SET INACTIVE.
Definition: dict0dd.h:207
@ DD_SPACE_STATE_NORMAL
Normal IBD tablespace.
Definition: dict0dd.h:193
@ DD_SPACE_STATE_INACTIVE
Inactive undo tablespace being truncated, selected explicitly by ALTER UNDO TABLESPACE SET INACTIVE.
Definition: dict0dd.h:204
@ DD_SPACE_STATE__LAST
Sentinel.
Definition: dict0dd.h:209
const char *const dd_index_key_strings[DD_INDEX__LAST]
InnoDB private key strings for dd::Index or dd::Partition_index.
Definition: dict0dd.h:264
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:70
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:1264
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:4117
const uint32_t DD_SPACE_CURRENT_SRV_VERSION
Server version that the tablespace created.
Definition: dict0dd.h:146
void dd_copy_autoinc(const dd::Properties &src, dd::Properties &dest)
Copy the AUTO_INCREMENT and version attribute if exist.
Definition: dict0dd.cc:1650
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:5830
const char *const dd_column_key_strings[DD_COLUMN__LAST]
InnoDB private key strings for dd::Column,.
Definition: dict0dd.h:238
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:6585
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:2018
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:175
bool dd_table_has_instant_add_cols(const dd::Table &table)
Determine if dd::Table has INSTANT ADD columns.
Definition: dict0dd.h:433
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:4709
void dd_open_fk_tables(dict_names_t &fk_list, bool dict_locked, THD *thd)
Open foreign tables reference a table.
Definition: dict0dd.cc:5394
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:1991
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:421
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:6905
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:6884
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:2420
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:1756
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:1087
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:2803
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:5494
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:5479
bool dd_table_has_instant_drop_cols(const dd::Table &table)
Determine if dd::Table has INSTANT DROPPED columns.
Definition: dict0dd.h:450
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:6948
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:1923
const Index * dd_first(const Table *table)
Get the first index of a table or partition.
Definition: dict0dd.h:676
bool dd_tablespace_update_cache(THD *thd)
Update all InnoDB tablespace cache objects.
Definition: dict0dd.cc:7162
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:3521
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:388
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:6777
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:597
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:4512
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:6170
void release_uncached_table(TABLE_SHARE *ts, TABLE *td)
free uncached table definition.
Definition: dict0dd.cc:370
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:5528
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:3678
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:375
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:2441
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:4761
void dd_mdl_release(THD *thd, MDL_ticket **mdl)
Release a metadata lock.
Definition: dict0dd.cc:299
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:770
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:4043
dd::Object_id dd_get_space_id(const dd::Table &table)
Get the explicit dd::Tablespace::id of a table.
Definition: dict0dd.h:711
void dd_part_adjust_table_id(dd::Table *new_table)
Adjust TABLE_ID for partitioned table after ALTER TABLE ... PARTITION.
Definition: dict0dd.cc:1841
static bool is_system_column(const char *col_name)
Definition: dict0dd.h:464
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
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
constexpr space_id_t SPACE_UNKNOWN
Unknown space id.
Definition: fil0fil.h:1137
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:296
#define MY_COMPILER_DIAGNOSTIC_POP()
restore the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:297
#define MY_COMPILER_CLANG_WORKAROUND_TPARAM_DOCBUG()
ignore -Wdocumentation compiler warnings for @tparam.
Definition: my_compiler.h:319
static char * server_version
Definition: mysql.cc:109
Common definition between mysql server & client.
#define MYSQL_VERSION_ID
Definition: mysql_version.h:15
static char * path
Definition: mysqldump.cc:137
std::string HARNESS_EXPORT foreground(Color c)
get 'change foreground color' ESC sequence.
Definition: vt100.cc:133
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:421
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:1110
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:676
case opt name
Definition: sslopt-case.h:33
Definition: m_ctype.h:385
Struct to hold information about the table that should be created.
Definition: handler.h:3045
This structure is shared between different table objects.
Definition: table.h:690
Definition: btr0pcur.h:99
Data structure for a column in a table.
Definition: dict0mem.h:489
Data structure for an index.
Definition: dict0mem.h:1046
Data structure for a database table.
Definition: dict0mem.h:1909
Hard-coded data dictionary information.
Definition: dict0dd.h:286
const char * name
Data dictionary table name.
Definition: dict0dd.h:288
const uint n_indexes
Number of indexes.
Definition: dict0dd.h:290
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
unsigned int uint
Definition: uca9-dump.cc:75
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:69
static int is_config(cargo_type x)
Definition: xcom_base.cc:2158