MySQL  8.0.21
Source Code Documentation

Inline utility functions used in different TUs. More...

#include "my_dbug.h"
#include "sql/current_thd.h"
#include "sql/dd/string_type.h"
#include "sql/error_handler.h"
#include "sql/mdl.h"
#include "sql/sql_class.h"

Go to the source code of this file.

Classes

class  dd::sdi_utils::Closure_error_handler< CONDITION_HANDLER_CLOS >
 Class template which derives from Internal_error_handler and overrides handle_condition with the CONDITION_HANDLER_CLOS template parameter. More...
 

Namespaces

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

Macros

#define ENTITY_FMT   "(%s, %llu)"
 
#define ENTITY_VAL(obj)   (obj).name().c_str(), (obj).id()
 

Functions

bool dd::sdi_utils::checked_return (bool ret)
 In debug mode, check that a true argument is paired with thd->is_error() or thd->killed being set. More...
 
bool dd::sdi_utils::mdl_lock (THD *thd, MDL_key::enum_mdl_namespace ns, const String_type &schema_name, const String_type &object_name, enum_mdl_type mt=MDL_EXCLUSIVE, enum_mdl_duration md=MDL_TRANSACTION)
 Convenience function for obtaining MDL. More...
 
template<typename T >
const T & dd::sdi_utils::ptr_as_cref (const T *p)
 
template<typename CH_CLOS , typename ACTION_CLOS >
bool dd::sdi_utils::handle_errors (THD *thd, CH_CLOS &&chc, ACTION_CLOS &&ac)
 Set up a custom error handler to use for errors from the execution of a closure. More...
 
template<typename P_TYPE , typename CLOS_TYPE >
std::unique_ptr< P_TYPE, CLOS_TYPE > dd::sdi_utils::make_guard (P_TYPE *p, CLOS_TYPE &&clos)
 

Detailed Description

Inline utility functions used in different TUs.

Declared inline in header to avoid any overhead as they are only a syntactic convnience (macro replacement).

Macro Definition Documentation

◆ ENTITY_FMT

#define ENTITY_FMT   "(%s, %llu)"

◆ ENTITY_VAL

#define ENTITY_VAL (   obj)    (obj).name().c_str(), (obj).id()