Functions for storing and dropping (deleting) SDIs.
More...
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.
◆ 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
-
- Returns
- error status
- Return values
-
◆ 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
-
thd | thread context |
t | Table object. |
- Returns
- error status
- Return values
-
false | on success |
true | otherwise |
◆ 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
-
thd | thread context |
old_ddo | old DD object |
new_ddo | new DD object |
- Returns
- error status
- Return values
-
◆ 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
-
thd | thread context |
old_t | old Schema object |
new_t | new Schema object |
- Returns
- error status
- Return values
-
false | on success |
true | otherwise |
◆ 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
-
thd | thread context |
ddo | DD object |
- Returns
- error status
- Return values
-
◆ 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
-
thd | thread context |
t | Table object. |
- Returns
- error status
- Return values
-
false | on success |
true | otherwise |
◆ store() [3/3]
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
-
thd | thread context |
ts | Tablespace object. |
- Returns
- error status
- Return values
-
false | on success |
true | otherwise |