MySQL  8.0.19
Source Code Documentation
#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 <string>
#include <vector>
#include "m_ctype.h"
#include "m_string.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sys.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/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"

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

 dd
 The version of the current data dictionary table definitions.
 
 dd::sdi
 
 sdi_unittest
 

Functions

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 postion index opx (ordinal position opx+1). More...
 
Columndd::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::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...
 
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...
 
template<class Dd_type >
bool dd::generic_deserialize (THD *thd, const Sdi_type &sdi, const String_type &object_type_name, Dd_type *dst, String_type *schema_name_from_sdi=nullptr)
 
bool dd::deserialize (THD *thd, const Sdi_type &sdi, Table *table, String_type *deser_schema_name=nullptr)
 Deserialize a dd::Table object. More...
 
bool dd::deserialize (THD *thd, const Sdi_type &sdi, Tablespace *tablespace)
 Deserialize a dd::Tablespace 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...
 
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

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: