MySQL 8.0.40
Source Code Documentation
|
Definition of externally visible functions and classes, declared in sdi.h. More...
Namespaces | |
namespace | dd::anonymous_namespace{sdi.cc} |
namespace | dd::sdi |
namespace | dd::sdi::anonymous_namespace{sdi.cc} |
Typedefs | |
using | dd::anonymous_namespace{sdi.cc}::DC = dd::cache::Dictionary_client |
using | dd::anonymous_namespace{sdi.cc}::AR = dd::cache::Dictionary_client::Auto_releaser |
Functions | |
dd::Sdi_wcontext::Sdi_wcontext (THD *thd, const String_type *schema_name) | |
bool | dd::Sdi_wcontext::error () const |
void | dd::Sdi_wcontext::set_error () |
THD * | dd::Sdi_wcontext::thd () const |
dd::Sdi_rcontext::Sdi_rcontext (THD *thd, uint target_dd_version, std::uint64_t sdi_version) | |
bool | dd::Sdi_rcontext::error () const |
template<typename DDT > | |
static handlerton * | dd::anonymous_namespace{sdi.cc}::resolve_hton (THD *thd, const DDT &ddt) |
Templated convenience wrapper which first attempts to resolve the handlerton using the data dictionary object's engine() string. More... | |
template<class AKT , class CLOS > | |
bool | dd::anonymous_namespace{sdi.cc}::with_schema (THD *thd, const AKT &key, CLOS &&clos) |
Covenience function for acquiring the schema and invoking a closure which uses the schema object. More... | |
template<class CHAR_IT > | |
bool | dd::anonymous_namespace{sdi.cc}::equal_prefix_chars (CHAR_IT &&begin1, CHAR_IT &&end1, CHAR_IT &&begin2, CHAR_IT &&end2, size_t n, const CHARSET_INFO *csi=system_charset_info) |
Predicate which returns true if an n-character prefix of two character ranges are equal. More... | |
template<class DDT > | |
bool | dd::anonymous_namespace{sdi.cc}::equal_prefix_chars_name (const DDT &a, const DDT &b, size_t prefix_chars) |
Convenience function for comparing a prefix of the names of two DD objects. More... | |
bool | dd::sdi::store (THD *thd, const Tablespace *ts) |
Stores the SDI for a table space. More... | |
template<typename DDT > | |
bool | dd::sdi::anonymous_namespace{sdi.cc}::drop_all_impl (THD *thd, const DDT *tp) |
bool | dd::sdi::drop_all_for_table (THD *, const Table *) |
Drop all SDIs from all tablespaces associated with table. More... | |
bool | dd::sdi::drop_all_for_part (THD *, const Partition *) |
Drop all SDIs from all tablespaces associated with partition or sub-partition. More... | |
dd::Sdi_wcontext | sdi_unittest::drv_wctx (nullptr, &drv_s) |
dd::Sdi_wcontext * | sdi_unittest::get_wctx () |
dd::Sdi_rcontext * | sdi_unittest::get_rctx () |
bool | sdi_unittest::equal_prefix_chars_driver (const dd::String_type &a, const dd::String_type &b, size_t prefix) |
Friends | |
char * | dd::Sdi_wcontext::buf_handle (Sdi_wcontext *wctx, size_t sz) |
Return a non-owning pointer to a char buffer which can be used for e.g. More... | |
const String_type & | dd::Sdi_wcontext::lookup_schema_name (Sdi_wcontext *wctx) |
Returns const reference to string holding schema name to use in SDI. More... | |
void | dd::Sdi_rcontext::track_object (Sdi_rcontext *rctx, Column *column_object) |
Register Column objects being deserialized so that it will be possible to resolve references to it after deserialization has finished. More... | |
void | dd::Sdi_rcontext::track_object (Sdi_rcontext *rctx, Index *index_object) |
Register Index objects being deserialized so that it will be possible to resolve references to it after deserialization has finished. More... | |
Index * | dd::Sdi_rcontext::get_by_opx (Sdi_rcontext *rctx, const Index *, uint opx) |
Return an non-owning raw pointer to the deserialized Index object with ordinal position index opx (ordinal position opx+1). More... | |
Column * | dd::Sdi_rcontext::get_by_opx (Sdi_rcontext *rctx, const Column *, uint opx) |
Return an non-owning raw pointer to the deserialized Column object with ordinal position index opx (ordinal position opx+1). More... | |
char * | dd::Sdi_rcontext::buf_handle (Sdi_rcontext *rctx, size_t sz) |
Return a non-owning pointer to a char buffer which can be used for e.g. More... | |
bool | dd::Sdi_rcontext::lookup_schema_ref (Sdi_rcontext *rctx, const String_type &name, dd::Object_id *idp) |
Return the the Object_id of a schema name in the current data dictionary. More... | |
bool | dd::Sdi_rcontext::lookup_tablespace_ref (Sdi_rcontext *rctx, const String_type &name, Object_id *idp) |
Return the the Object_id of a tablespace name in the current data dictionary. More... | |
Sdi_type | dd::serialize (const Tablespace &tablespace) |
Serialize a Tablespace object. More... | |
bool | dd::CheckDefaultCompatibility (const RJ_Document &doc) |
Default checker which implements the traditional (strict) compatibility check: MYSQL_VERSION less than or equal, dd_version equal, and sdi_version equal. More... | |
template<class Dd_type > | |
bool | dd::generic_deserialize (THD *thd, const Sdi_type &sdi, const String_type &object_type_name, Dd_type *dst, const SdiCompatibilityChecker &comp_checker, String_type *schema_name_from_sdi) |
bool | dd::deserialize (THD *thd, const Sdi_type &sdi, Table *dst_table, SdiCompatibilityChecker comp_checker, String_type *deser_schema_name) |
Deserialize a dd::Table object. More... | |
bool | dd::deserialize (THD *thd, const Sdi_type &sdi, Tablespace *dst_tablespace, SdiCompatibilityChecker comp_checker) |
Deserialize a dd::Tablespace object. More... | |
Definition of externally visible functions and classes, declared in sdi.h.
using dd::anonymous_namespace{sdi.cc}::AR = typedef dd::cache::Dictionary_client::Auto_releaser |
using dd::anonymous_namespace{sdi.cc}::DC = typedef dd::cache::Dictionary_client |
|
inline |
|
inline |
bool dd::CheckDefaultCompatibility | ( | const RJ_Document & | doc | ) |
Default checker which implements the traditional (strict) compatibility check: MYSQL_VERSION less than or equal, dd_version equal, and sdi_version equal.
bool dd::deserialize | ( | THD * | thd, |
const Sdi_type & | sdi, | ||
Table * | dst_table, | ||
SdiCompatibilityChecker | comp_checker, | ||
String_type * | deser_schema_name | ||
) |
Deserialize a dd::Table object.
Populates the dd::Table object provided with data from sdi string. Note! Additional objects are dynamically allocated and added to the top-level Schema object, which assumes ownership.
thd | thread context |
sdi | serialized representation of schema (as a json string) |
dst_table | empty top-level object |
comp_checker | callable which will be used to determine if the SDI is compatible |
deser_schema_name | name of schema containing the table |
false | if successful |
true | otherwise |
bool dd::deserialize | ( | THD * | thd, |
const Sdi_type & | sdi, | ||
Tablespace * | dst_tablespace, | ||
SdiCompatibilityChecker | comp_checker | ||
) |
Deserialize a dd::Tablespace object.
Populates the dd::Tablespace object provided with data from sdi string. Note! Additional objects are dynamically allocated and added to the top-level Tablespace object, which assumes ownership.
thd | thread context |
sdi | serialized representation of schema (as a json string) |
dst_tablespace | empty top-level object |
comp_checker | callable which will be used to determine if the SDI is compatible. |
false | if successful |
true | otherwise |
Drop all SDIs from all tablespaces associated with partition or sub-partition.
For a top-level partition of a sub-partitioned table, SDIs are removed for all sub-partitions of that partition.
Drop all SDIs from all tablespaces associated with table.
For a partitioned table SDIs are deleted from all the partition tablespaces.
bool dd::sdi::anonymous_namespace{sdi.cc}::drop_all_impl | ( | THD * | thd, |
const DDT * | tp | ||
) |
dd::Sdi_wcontext sdi_unittest::drv_wctx | ( | nullptr | , |
& | drv_s | ||
) |
bool dd::anonymous_namespace{sdi.cc}::equal_prefix_chars | ( | CHAR_IT && | begin1, |
CHAR_IT && | end1, | ||
CHAR_IT && | begin2, | ||
CHAR_IT && | end2, | ||
size_t | n, | ||
const CHARSET_INFO * | csi = system_charset_info |
||
) |
Predicate which returns true if an n-character prefix of two character ranges are equal.
begin1 | beginning of first range |
end1 | end of first range |
begin2 | beginning of second range |
end2 | end of second range |
n | number of characters to compare |
csi | character set to use (defaults to system_charset_info) |
bool sdi_unittest::equal_prefix_chars_driver | ( | const dd::String_type & | a, |
const dd::String_type & | b, | ||
size_t | prefix | ||
) |
bool dd::anonymous_namespace{sdi.cc}::equal_prefix_chars_name | ( | const DDT & | a, |
const DDT & | b, | ||
size_t | prefix_chars | ||
) |
Convenience function for comparing a prefix of the names of two DD objects.
a | first DD object |
b | second DD object |
prefix_chars | number characters in prefix to compare |
|
inline |
|
inline |
bool dd::generic_deserialize | ( | THD * | thd, |
const Sdi_type & | sdi, | ||
const String_type & | object_type_name, | ||
Dd_type * | dst, | ||
const SdiCompatibilityChecker & | comp_checker, | ||
String_type * | schema_name_from_sdi | ||
) |
dd::Sdi_rcontext * sdi_unittest::get_rctx | ( | ) |
dd::Sdi_wcontext * sdi_unittest::get_wctx | ( | ) |
|
static |
Templated convenience wrapper which first attempts to resolve the handlerton using the data dictionary object's engine() string.
thd | thread context |
ddt | Data dictionary object |
handlerton | pointer on success |
nullptr | on error |
Sdi_type dd::serialize | ( | const Tablespace & | tablespace | ) |
Serialize a Tablespace object.
tablespace | object which will be serialized |
|
inline |
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.
thd | thread context |
ts | Tablespace object. |
false | on success |
true | otherwise |
|
inline |
bool dd::anonymous_namespace{sdi.cc}::with_schema | ( | THD * | thd, |
const AKT & | key, | ||
CLOS && | clos | ||
) |
Covenience function for acquiring the schema and invoking a closure which uses the schema object.
thd | thread context |
key | key to use when acquiring Schema object |
clos | closure to invoke with the Schema object |
false | on success |
true | otherwise |
|
private |
A reusable byte buffer for e.g.
base64 decoding.
dd::Sdi_rcontext sdi_unittest::drv_rctx(nullptr, 0, 0) | ( | nullptr | , |
0 | , | ||
0 | |||
) |
dd::String_type sdi_unittest::drv_s = "driver_schema" |
|
private |
A reusable byte buffer for e.g.
base64 encoding.
Column objects created during deserialization.
|
private |
Flag indicating that an error has occurred.
|
private |
Flag indicating that an error has occurred.
Index objects created during deserialization.
|
private |
Pointer to schema name to use for schema references in SDI.
String_type dd::Sdi_rcontext::m_schema_name |
|
private |
Sdi version from SDI.
|
private |
Target dd version from SDI.
|
private |
Thread context.
|
private |
Thread context.
|
friend |
Return a non-owning pointer to a char buffer which can be used for e.g.
base64 encoding.
rctx | opaque context |
sz | size of buffer |
|
friend |
Return a non-owning pointer to a char buffer which can be used for e.g.
base64 encoding.
wctx | opaque context. |
sz | size of buffer. |
|
friend |
Return an non-owning raw pointer to the deserialized Column object with ordinal position index opx (ordinal position opx+1).
The unused const Column* argument is needed for overload resolution.
rctx | opaque context |
opx | ordinal position index |
|
friend |
Return an non-owning raw pointer to the deserialized Index object with ordinal position index opx (ordinal position opx+1).
The unused const Index* argument is needed for overload resolution.
rctx | opaque context |
opx | ordinal position index |
|
friend |
Returns const reference to string holding schema name to use in SDI.
wctx | opaque context. |
|
friend |
Return the the Object_id of a schema name in the current data dictionary.
Used to recreate a reference to a schema during deserialization.
rctx | opaque context. |
name | schema name used as reference. |
idp | [OUT] pointer to Object_id variable where result is stored. |
|
friend |
Return the the Object_id of a tablespace name in the current data dictionary.
Used to recreate a reference to a tablespace during deserialization.
rctx | opaque context. |
name | schema name used as reference. |
idp | [OUT] pointer to Object_id variable where result is stored. |
|
friend |
Register Column objects being deserialized so that it will be possible to resolve references to it after deserialization has finished.
rctx | opaque context |
column_object | object which may be referenced by other objects. |
|
friend |
Register Index objects being deserialized so that it will be possible to resolve references to it after deserialization has finished.
rctx | opaque context |
index_object | object which may be referenced by other objects. |