MySQL  8.0.21
Source Code Documentation

Definition of externally visible functions and classes, declared in sdi.h. More...

Namespaces

 dd::sdi
 

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 ()
 
THDdd::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
 
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...
 
dd::Sdi_wcontext sdi_unittest::drv_wctx (nullptr, &drv_s)
 
dd::Sdi_wcontextsdi_unittest::get_wctx ()
 
dd::Sdi_rcontextsdi_unittest::get_rctx ()
 
bool sdi_unittest::equal_prefix_chars_driver (const dd::String_type &a, const dd::String_type &b, size_t prefix)
 

Variables

Byte_buffer dd::Sdi_wcontext::m_buf
 A reusable byte buffer for e.g. More...
 
THDdd::Sdi_wcontext::m_thd
 Thread context. More...
 
const String_typedd::Sdi_wcontext::m_schema_name
 Pointer to schema name to use for schema references in SDI. More...
 
bool dd::Sdi_wcontext::m_error
 Flag indicating that an error has occurred. More...
 
Byte_buffer dd::Sdi_rcontext::buf
 A reusable byte buffer for e.g. More...
 
dd_vector< Column * > dd::Sdi_rcontext::m_column_object_opx
 Column objects created during deserialization. More...
 
dd_vector< Index * > dd::Sdi_rcontext::m_index_object_opx
 Index objects created during deserialization. More...
 
THDdd::Sdi_rcontext::m_thd
 Thread context. More...
 
uint dd::Sdi_rcontext::m_target_dd_version
 Target dd version from SDI. More...
 
std::uint64_t dd::Sdi_rcontext::m_sdi_version
 Sdi version from SDI. More...
 
bool dd::Sdi_rcontext::m_error
 Flag indicating that an error has occurred. More...
 
String_type dd::Sdi_rcontext::m_schema_name
 
dd::String_type sdi_unittest::drv_s = "driver_schema"
 
dd::Sdi_rcontext sdi_unittest::drv_rctx (nullptr, 0, 0)
 

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_typedd::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...
 
Indexdd::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 postion index opx (ordinal position opx+1). More...
 
Columndd::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 postion 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...
 

Detailed Description

Definition of externally visible functions and classes, declared in sdi.h.

Function Documentation

◆ Sdi_rcontext()

dd::Sdi_rcontext::Sdi_rcontext ( THD thd,
uint  target_dd_version,
std::uint64_t  sdi_version 
)
inline

◆ Sdi_wcontext()

dd::Sdi_wcontext::Sdi_wcontext ( THD thd,
const String_type schema_name 
)
inline

◆ CheckDefaultCompatibility()

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.

◆ deserialize() [1/2]

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.

Parameters
thdthread context
sdiserialized representation of schema (as a json string)
dst_tableempty top-level object
comp_checkercallable which will be used to determine if the SDI is compatible
deser_schema_namename of schema containing the table
Returns
error status
Return values
falseif successful
trueotherwise

◆ deserialize() [2/2]

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.

Parameters
thdthread context
sdiserialized representation of schema (as a json string)
dst_tablespaceempty top-level object
comp_checkercallable which will be used to determine if the SDI is compatible.
Returns
error status
Return values
falseif successful
trueotherwise

◆ drv_wctx()

dd::Sdi_wcontext sdi_unittest::drv_wctx ( nullptr  ,
drv_s 
)

◆ equal_prefix_chars_driver()

bool sdi_unittest::equal_prefix_chars_driver ( const dd::String_type a,
const dd::String_type b,
size_t  prefix 
)

◆ error() [1/2]

bool dd::Sdi_wcontext::error ( ) const
inline

◆ error() [2/2]

bool dd::Sdi_rcontext::error ( ) const
inline

◆ generic_deserialize()

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 
)

◆ get_rctx()

dd::Sdi_rcontext* sdi_unittest::get_rctx ( )

◆ get_wctx()

dd::Sdi_wcontext* sdi_unittest::get_wctx ( )

◆ set_error()

void dd::Sdi_wcontext::set_error ( )
inline

◆ thd()

THD* dd::Sdi_wcontext::thd ( ) const
inline

Variable Documentation

◆ buf

Byte_buffer dd::Sdi_rcontext::buf
private

A reusable byte buffer for e.g.

base64 decoding.

◆ drv_rctx

dd::Sdi_rcontext sdi_unittest::drv_rctx(nullptr, 0, 0)

◆ drv_s

dd::String_type sdi_unittest::drv_s = "driver_schema"

◆ m_buf

Byte_buffer dd::Sdi_wcontext::m_buf
private

A reusable byte buffer for e.g.

base64 encoding.

◆ m_column_object_opx

dd_vector<Column *> dd::Sdi_rcontext::m_column_object_opx
private

Column objects created during deserialization.

◆ m_error [1/2]

bool dd::Sdi_wcontext::m_error
private

Flag indicating that an error has occurred.

◆ m_error [2/2]

bool dd::Sdi_rcontext::m_error
private

Flag indicating that an error has occurred.

◆ m_index_object_opx

dd_vector<Index *> dd::Sdi_rcontext::m_index_object_opx
private

Index objects created during deserialization.

◆ m_schema_name [1/2]

const String_type* dd::Sdi_wcontext::m_schema_name
private

Pointer to schema name to use for schema references in SDI.

◆ m_schema_name [2/2]

String_type dd::Sdi_rcontext::m_schema_name

◆ m_sdi_version

std::uint64_t dd::Sdi_rcontext::m_sdi_version
private

Sdi version from SDI.

◆ m_target_dd_version

uint dd::Sdi_rcontext::m_target_dd_version
private

Target dd version from SDI.

◆ m_thd [1/2]

THD* dd::Sdi_wcontext::m_thd
private

Thread context.

◆ m_thd [2/2]

THD* dd::Sdi_rcontext::m_thd
private

Thread context.

Friends

◆ buf_handle [1/2]

char* buf_handle ( Sdi_wcontext wctx,
size_t  sz 
)
friend

Return a non-owning pointer to a char buffer which can be used for e.g.

base64 encoding.

Parameters
wctxopaque context.
szsize of buffer.

◆ buf_handle [2/2]

char* buf_handle ( Sdi_rcontext rctx,
size_t  sz 
)
friend

Return a non-owning pointer to a char buffer which can be used for e.g.

base64 encoding.

Parameters
rctxopaque context
szsize of buffer
Returns
non-owning pointer to buffer

◆ get_by_opx [1/2]

Index* get_by_opx ( Sdi_rcontext rctx,
const Index ,
uint  opx 
)
friend

Return an non-owning raw pointer to the deserialized Index object with ordinal postion index opx (ordinal position opx+1).

The unused const Index* argument is needed for overload resolution.

Parameters
rctxopaque context
opxordinal position index

◆ get_by_opx [2/2]

Column* get_by_opx ( Sdi_rcontext rctx,
const Column ,
uint  opx 
)
friend

Return an non-owning raw pointer to the deserialized Column object with ordinal postion index opx (ordinal position opx+1).

The unused const Column* argument is needed for overload resolution.

Parameters
rctxopaque context
opxordinal position index

◆ lookup_schema_name

const String_type& lookup_schema_name ( Sdi_wcontext wctx)
friend

Returns const reference to string holding schema name to use in SDI.

Parameters
wctxopaque context.
Returns
schema name to use.

◆ lookup_schema_ref

bool lookup_schema_ref ( Sdi_rcontext rctx,
const String_type name,
dd::Object_id idp 
)
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.

Parameters
rctxopaque context.
nameschema name used as reference.
idp[OUT] pointer to Object_id variable where result is stored.
Returns
MySQL error handling.

◆ lookup_tablespace_ref

bool lookup_tablespace_ref ( Sdi_rcontext rctx,
const String_type name,
Object_id idp 
)
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.

Parameters
rctxopaque context.
nameschema name used as reference.
idp[OUT] pointer to Object_id variable where result is stored.
Returns
MySQL error handling.

◆ track_object [1/2]

void track_object ( Sdi_rcontext rctx,
Column column_object 
)
friend

Register Column objects being deserialized so that it will be possible to resolve references to it after deserialization has finished.

Parameters
rctxopaque context
column_objectobject which may be referenced by other objects.

◆ track_object [2/2]

void track_object ( Sdi_rcontext rctx,
Index index_object 
)
friend

Register Index objects being deserialized so that it will be possible to resolve references to it after deserialization has finished.

Parameters
rctxopaque context
index_objectobject which may be referenced by other objects.