MySQL  8.0.21
Source Code Documentation

Functions for storing and dropping (deleting) SDIs. More...

Functions

template<class DDT >
bool dd::sdi::store (THD *thd, const DDT *ddo)
 Generic noop for all types that don't have a specific overload. More...
 
template<class DDT >
bool dd::sdi::drop (THD *thd, const DDT *)
 Generic noop for all types that don't have a specific overload. More...
 
template<class DDT >
bool dd::sdi::drop_after_update (THD *thd, const DDT *old_ddo, const DDT *new_ddo)
 Hook for SDI cleanup after updating DD object. More...
 
bool dd::sdi::store (THD *thd, const Table *t)
 Stores the SDI for a table. More...
 
bool dd::sdi::store (THD *thd, const Tablespace *ts)
 Stores the SDI for a table space. More...
 
bool dd::sdi::drop (THD *thd, const Table *t)
 Remove SDI for a table. More...
 
bool dd::sdi::drop_after_update (THD *thd, const Table *old_t, const Table *new_t)
 Table cleanup hook. More...
 

Detailed Description

Functions for storing and dropping (deleting) SDIs.

To be used from dd::cache::Storage_adapter and dd::cache::Dictionary_client to store and remove SDIs as DD objects are added, modified or deleted.

Function Documentation

◆ drop() [1/2]

template<class DDT >
bool dd::sdi::drop ( THD thd,
const DDT *   
)
inline

Generic noop for all types that don't have a specific overload.

No SDIs are removed for these types.

Parameters
thdthread context
Returns
error status
Return values
falsealways

◆ drop() [2/2]

bool dd::sdi::drop ( THD thd,
const Table t 
)

Remove SDI for a table.

Forwards to SE through handlerton api, which will remove from tablespace, or falls back to deleting the .SDI file in the default case.

Parameters
thdthread context
tTable object.
Returns
error status
Return values
falseon success
trueotherwise

◆ drop_after_update() [1/2]

template<class DDT >
bool dd::sdi::drop_after_update ( THD thd,
const DDT *  old_ddo,
const DDT *  new_ddo 
)
inline

Hook for SDI cleanup after updating DD object.

Generic noop for all types that don't have a specific overload.

Parameters
thdthread context
old_ddoold DD object
new_ddonew DD object
Returns
error status
Return values
falsealways

◆ drop_after_update() [2/2]

bool dd::sdi::drop_after_update ( THD thd,
const Table old_t,
const Table new_t 
)

Table cleanup hook.

When a Dictionary_client issues a store which is performed as an update in the DD a new table SDI file will be stored. If SDI is stored in a file and the update modifies the name of the table it is necessary to remove the old SDI file after the new one has been written successfully. If the file names are the same the file is updated in place, potentially leaving it corrupted if something goes wrong. If the SDI is stored in a tablespace it will use the same key even if the names change and the update will transactional so then this hook does nothing.

Parameters
thdthread context
old_told Schema object
new_tnew Schema object
Returns
error status
Return values
falseon success
trueotherwise

◆ store() [1/3]

template<class DDT >
bool dd::sdi::store ( THD thd,
const DDT *  ddo 
)
inline

Generic noop for all types that don't have a specific overload.

No SDIs are written for these types.

Parameters
thdthread context
ddoDD object
Returns
error status
Return values
falsealways

◆ store() [2/3]

bool dd::sdi::store ( THD thd,
const Table t 
)

Stores the SDI for a table.

Serializes the table, and then forwards to SE through handlerton api, or falls back to storing the sdi string in an .SDI file in the default case. The schema object is serialized and stored if the schema's SDI file does not exist, or if is missing from the tablespace used to store the table.

Parameters
thdthread context
tTable object.
Returns
error status
Return values
falseon success
trueotherwise

◆ store() [3/3]

bool dd::sdi::store ( THD thd,
const Tablespace ts 
)

Stores the SDI for a table space.

Serializes the table space object, and then forwards to SE through handlerton api, or falls back to storing the sdi string in an .SDI file in the default case.

Parameters
thdthread context
tsTablespace object.
Returns
error status
Return values
falseon success
trueotherwise