MySQL 8.4.0
Source Code Documentation
dict0upgrade.h File Reference
#include "my_inttypes.h"

Go to the source code of this file.

Namespaces

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

Functions

bool dd_upgrade_table (THD *thd, const char *db_name, const char *table_name, dd::Table *dd_table, TABLE *srv_table)
 Migrate table from InnoDB Dictionary (INNODB SYS_*) tables to new Data Dictionary. More...
 
int dd_upgrade_tablespace (THD *thd)
 Migrate tablespace entries from InnoDB SYS_TABLESPACES to new data dictionary. More...
 
bool upgrade_space_version (const uint32_t space_id, bool server_version_only)
 Add server and space version number to tablespace while upgrading. More...
 
bool upgrade_space_version (dd::Tablespace *tablespace)
 Add server version number to tablespace while upgrading. More...
 
int dd_upgrade_logs (THD *thd)
 Upgrade innodb undo logs after upgrade. More...
 
int dd_upgrade_finish (THD *thd, bool failed_upgrade)
 If upgrade is successful, this API is used to flush innodb dirty pages to disk. More...
 

Variables

uint32_t dd_upgrade_indexes_num
 

Function Documentation

◆ dd_upgrade_finish()

int dd_upgrade_finish ( THD thd,
bool  failed_upgrade 
)

If upgrade is successful, this API is used to flush innodb dirty pages to disk.

In case of server crash, this function sets storage engine for rollback any changes.

Parameters
[in,out]thdTHD
[in]failed_upgradetrue when upgrade failed
Returns
MySQL error code

◆ dd_upgrade_logs()

int dd_upgrade_logs ( THD thd)

Upgrade innodb undo logs after upgrade.

Also increment the table_id offset by DICT_MAX_DD_TABLES. This offset increment is because the first 256 table_ids are reserved for dictionary.

Parameters
[in,out]thdTHD
Returns
MySQL error code

◆ dd_upgrade_table()

bool dd_upgrade_table ( THD thd,
const char *  db_name,
const char *  table_name,
dd::Table dd_table,
TABLE srv_table 
)

Migrate table from InnoDB Dictionary (INNODB SYS_*) tables to new Data Dictionary.

Since FTS tables contain table_id in their physical file name and during upgrade we reserve DICT_MAX_DD_TABLES for dictionary tables. So we rename FTS tablespace files

Parameters
[in]thdServer thread object
[in]db_namedatabase name
[in]table_nametable name
[in,out]dd_tablenew dictionary table object to be filled
[in]srv_tableserver table object
Returns
false on success, true on failure.

◆ dd_upgrade_tablespace()

int dd_upgrade_tablespace ( THD thd)

Migrate tablespace entries from InnoDB SYS_TABLESPACES to new data dictionary.

FTS Tablespaces are not registered as they are handled differently. FTS tablespaces have table_id in their name and we increment table_id of each table by DICT_MAX_DD_TABLES

Parameters
[in,out]thdTHD
Returns
MySQL error code

◆ upgrade_space_version() [1/2]

bool upgrade_space_version ( const uint32_t  space_id,
bool  server_version_only 
)

Add server and space version number to tablespace while upgrading.

Parameters
[in]space_idspace id of tablespace
[in]server_version_onlyleave space version unchanged
Returns
false on success, true on failure.

◆ upgrade_space_version() [2/2]

bool upgrade_space_version ( dd::Tablespace tablespace)

Add server version number to tablespace while upgrading.

Parameters
[in]tablespacedd::Tablespace
Returns
false on success, true on failure.

Variable Documentation

◆ dd_upgrade_indexes_num

uint32_t dd_upgrade_indexes_num
extern