MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
row_copy.cc File Reference
#include "database/row_copy.h"
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <limits>
#include <memory>
#include <stdexcept>
#include <utility>
#include "utils/utils_string.h"

Namespaces

namespace  shcore
 
namespace  shcore::polyglot
 
namespace  shcore::polyglot::database
 

Macros

#define FIELD_ERROR(index, msg)
 
#define FIELD_ERROR1(index, msg, arg)
 
#define VALIDATE_INDEX(index)
 
#define GET_VALIDATE_TYPE(index, TYPE_CHECK)
 

Macro Definition Documentation

◆ FIELD_ERROR

#define FIELD_ERROR (   index,
  msg 
)
Value:
std::invalid_argument( \
shcore::str_format("%s(%u): " msg, __FUNCTION__, index).c_str())
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:75
std::string str_format(const char *formats,...)
Return a formatted a string.
Definition: utils_string.cc:105

◆ FIELD_ERROR1

#define FIELD_ERROR1 (   index,
  msg,
  arg 
)
Value:
std::invalid_argument( \
shcore::str_format("%s(%u): " msg, __FUNCTION__, index, arg).c_str())

◆ GET_VALIDATE_TYPE

#define GET_VALIDATE_TYPE (   index,
  TYPE_CHECK 
)
Value:
if (index >= num_fields()) throw FIELD_ERROR(index, "index out of bounds"); \
if (_data->fields[index] == nullptr) \
throw FIELD_ERROR(index, "field is NULL"); \
ftype = get_type(index); \
if (!(TYPE_CHECK)) \
throw FIELD_ERROR1(index, "field type is %s", to_string(ftype).c_str());
static std::string to_string(const LEX_STRING &str)
Definition: lex_string.h:50
#define FIELD_ERROR1(index, msg, arg)
Definition: row_copy.cc:47
#define FIELD_ERROR(index, msg)
Definition: row_copy.cc:43
const char * get_type(TYPELIB *typelib, unsigned int nr)

◆ VALIDATE_INDEX

#define VALIDATE_INDEX (   index)
Value:
do { \
if (index >= num_fields()) \
throw FIELD_ERROR(index, "index out of bounds"); \
} while (0)