MySQL 8.4.2
Source Code Documentation

Definition of all sdi functions, except those that are - (de)serialize() member function in data dictionary objects - function templates which are defined in sdi_impl.h. More...

#include "sql/dd/impl/sdi.h"
#include "my_rapidjson_size_t.h"
#include <rapidjson/document.h>
#include <rapidjson/error/en.h>
#include <rapidjson/prettywriter.h>
#include <rapidjson/stringbuffer.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "mysql/strings/m_ctype.h"
#include "mysql/udf_registration_types.h"
#include "mysql_version.h"
#include "mysqld_error.h"
#include "prealloced_array.h"
#include "sql/auth/sql_security_ctx.h"
#include "sql/dd/cache/dictionary_client.h"
#include "sql/dd/impl/dictionary_impl.h"
#include "sql/dd/impl/sdi_impl.h"
#include "sql/dd/impl/sdi_tablespace.h"
#include "sql/dd/impl/sdi_utils.h"
#include "sql/dd/object_id.h"
#include "sql/dd/sdi_file.h"
#include "sql/dd/sdi_fwd.h"
#include "sql/dd/types/abstract_table.h"
#include "sql/dd/types/column.h"
#include "sql/dd/types/index.h"
#include "sql/dd/types/partition.h"
#include "sql/dd/types/schema.h"
#include "sql/dd/types/table.h"
#include "sql/dd/types/tablespace.h"
#include "sql/handler.h"
#include "sql/mdl.h"
#include "sql/sql_class.h"
#include "sql/sql_plugin_ref.h"
#include "sql/strfunc.h"
#include "string_with_len.h"

Classes

class  dd::Sdi_wcontext
 Opaque context which keeps reusable resources needed during serialization. More...
 
class  dd::Sdi_rcontext
 Opaque context which keeps reusable resoureces needed during deserialization. More...
 

Namespaces

namespace  anonymous_namespace{sdi.cc}
 
namespace  dd
 The version of the current data dictionary table definitions.
 
namespace  dd::anonymous_namespace{sdi.cc}
 
namespace  dd::sdi
 
namespace  dd::sdi::anonymous_namespace{sdi.cc}
 
namespace  sdi_unittest
 Namespace from dd_sdi-t unit-test.
 

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

char * anonymous_namespace{sdi.cc}::generic_buf_handle (Byte_buffer *buf, size_t sz)
 
char * dd::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::lookup_schema_name (Sdi_wcontext *wctx)
 Returns const reference to string holding schema name to use in SDI. More...
 
template<typename T >
String_type dd::generic_serialize (THD *thd, const char *dd_object_type, size_t dd_object_type_size, const T &dd_obj, const String_type *schema_name)
 
const String_type & dd::lookup_tablespace_name (Sdi_wcontext *wctx, dd::Object_id id)
 Look up the tablespace name for a tablespace id. More...
 
template<typename T >
void dd::generic_track_object (dd_vector< T * > *tvp, T *t)
 
void dd::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::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::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::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::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...
 
template<typename T >
bool dd::generic_lookup_ref (THD *thd, MDL_key::enum_mdl_namespace mdlns, const String_type &name, dd::Object_id *idp)
 
bool dd::lookup_schema_ref (Sdi_rcontext *rctx, const String_type &name, Object_id *idp)
 Return the the Object_id of a schema name in the current data dictionary. More...
 
bool dd::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...
 
template<typename DDT >
static handlertondd::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 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...
 
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_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)
 
Sdi_type dd::serialize (THD *thd, const Table &table, const String_type &schema_name)
 Serialize a Table object. 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...
 

Variables

const dd::String_type anonymous_namespace{sdi.cc}::empty_ = ""
 
dd::String_type sdi_unittest::drv_s = "driver_schema"
 
dd::Sdi_rcontext sdi_unittest::drv_rctx (nullptr, 0, 0)
 

Detailed Description

Definition of all sdi functions, except those that are - (de)serialize() member function in data dictionary objects - function templates which are defined in sdi_impl.h.

The file is made up of 4 groups: