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

Namespaces

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

Macros

#define bit_uint1korr(A)   (*(((uint8_t *)(A))))
 
#define bit_uint2korr(A)
 
#define bit_uint3korr(A)
 
#define bit_uint4korr(A)
 
#define bit_uint5korr(A)
 
#define bit_uint6korr(A)
 
#define bit_uint7korr(A)
 
#define bit_uint8korr(A)
 
#define FIELD_ERROR(index, msg)
 
#define FIELD_ERROR1(index, msg, arg)
 
#define VALIDATE_INDEX(index)
 
#define VALIDATE_TYPE(index, TYPE_CHECK)
 

Macro Definition Documentation

◆ bit_uint1korr

#define bit_uint1korr (   A)    (*(((uint8_t *)(A))))

◆ bit_uint2korr

#define bit_uint2korr (   A)
Value:
((uint16_t)(((uint16_t)(((unsigned char *)(A))[1])) + \
((uint16_t)(((unsigned char *)(A))[0]) << 8)))

◆ bit_uint3korr

#define bit_uint3korr (   A)
Value:
((uint32_t)(((uint32_t)(((unsigned char *)(A))[2])) + \
(((uint32_t)(((unsigned char *)(A))[1])) << 8) + \
(((uint32_t)(((unsigned char *)(A))[0])) << 16)))

◆ bit_uint4korr

#define bit_uint4korr (   A)
Value:
((uint32_t)(((uint32_t)(((unsigned char *)(A))[3])) + \
(((uint32_t)(((unsigned char *)(A))[2])) << 8) + \
(((uint32_t)(((unsigned char *)(A))[1])) << 16) + \
(((uint32_t)(((unsigned char *)(A))[0])) << 24)))

◆ bit_uint5korr

#define bit_uint5korr (   A)
Value:
((uint64_t)(((uint32_t)(((unsigned char *)(A))[4])) + \
(((uint32_t)(((unsigned char *)(A))[3])) << 8) + \
(((uint32_t)(((unsigned char *)(A))[2])) << 16) + \
(((uint32_t)(((unsigned char *)(A))[1])) << 24)) + \
(((uint64_t)(((unsigned char *)(A))[0])) << 32))

◆ bit_uint6korr

#define bit_uint6korr (   A)
Value:
((uint64_t)(((uint32_t)(((unsigned char *)(A))[5])) + \
(((uint32_t)(((unsigned char *)(A))[4])) << 8) + \
(((uint32_t)(((unsigned char *)(A))[3])) << 16) + \
(((uint32_t)(((unsigned char *)(A))[2])) << 24)) + \
(((uint64_t)(((uint32_t)(((unsigned char *)(A))[1])) + \
(((uint32_t)(((unsigned char *)(A))[0]) << 8)))) \
<< 32))

◆ bit_uint7korr

#define bit_uint7korr (   A)
Value:
((uint64_t)(((uint32_t)(((unsigned char *)(A))[6])) + \
(((uint32_t)(((unsigned char *)(A))[5])) << 8) + \
(((uint32_t)(((unsigned char *)(A))[4])) << 16) + \
(((uint32_t)(((unsigned char *)(A))[3])) << 24)) + \
(((uint64_t)(((uint32_t)(((unsigned char *)(A))[2])) + \
(((uint32_t)(((unsigned char *)(A))[1])) << 8) + \
(((uint32_t)(((unsigned char *)(A))[0])) << 16))) \
<< 32))

◆ bit_uint8korr

#define bit_uint8korr (   A)
Value:
((uint64_t)(((uint32_t)(((unsigned char *)(A))[7])) + \
(((uint32_t)(((unsigned char *)(A))[6])) << 8) + \
(((uint32_t)(((unsigned char *)(A))[5])) << 16) + \
(((uint32_t)(((unsigned char *)(A))[4])) << 24)) + \
(((uint64_t)(((uint32_t)(((unsigned char *)(A))[3])) + \
(((uint32_t)(((unsigned char *)(A))[2])) << 8) + \
(((uint32_t)(((unsigned char *)(A))[1])) << 16) + \
(((uint32_t)(((unsigned char *)(A))[0])) << 24))) \
<< 32))

◆ FIELD_ERROR

#define FIELD_ERROR (   index,
  msg 
)
Value:
bad_field(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:
bad_field( \
shcore::str_format("%s(%u): " msg, __FUNCTION__, index, arg).c_str(), \

◆ VALIDATE_INDEX

#define VALIDATE_INDEX (   index)
Value:
do { \
if (index >= m_num_fields) \
throw FIELD_ERROR(index, "index out of bounds"); \
} while (0)
#define FIELD_ERROR(index, msg)
Definition: row.cc:101

◆ VALIDATE_TYPE

#define VALIDATE_TYPE (   index,
  TYPE_CHECK 
)
Value:
do { \
if (index >= m_num_fields) \
throw FIELD_ERROR(index, "index out of bounds"); \
if (_row[index] == nullptr) throw FIELD_ERROR(index, "field is NULL"); \
Type ftype = get_type(index); \
if (!(TYPE_CHECK)) \
throw FIELD_ERROR1(index, "field type is %s", to_string(ftype).c_str()); \
} while (0)
static std::string to_string(const LEX_STRING &str)
Definition: lex_string.h:50
if(!(yy_init))
Definition: lexyy.cc:1144
MediaType
Definition: media_type.h:33
required string type
Definition: replication_group_member_actions.proto:34
#define FIELD_ERROR1(index, msg, arg)
Definition: row.cc:105
const char * get_type(TYPELIB *typelib, unsigned int nr)
#define NULL
Definition: types.h:55