#include <PreparedStatement.h>
|
| MySQLPreparedStatement (MYSQL_STMT *stmt) |
|
| ~MySQLPreparedStatement () |
|
void | setBool (const uint8 index, const bool value) |
|
void | setUInt8 (const uint8 index, const uint8 value) |
|
void | setUInt16 (const uint8 index, const uint16 value) |
|
void | setUInt32 (const uint8 index, const uint32 value) |
|
void | setUInt64 (const uint8 index, const uint64 value) |
|
void | setInt8 (const uint8 index, const int8 value) |
|
void | setInt16 (const uint8 index, const int16 value) |
|
void | setInt32 (const uint8 index, const int32 value) |
|
void | setInt64 (const uint8 index, const int64 value) |
|
void | setFloat (const uint8 index, const float value) |
|
void | setDouble (const uint8 index, const double value) |
|
void | setBinary (const uint8 index, const std::vector< uint8 > &value, bool isString) |
|
void | setNull (const uint8 index) |
|
MySQLPreparedStatement::MySQLPreparedStatement |
( |
MYSQL_STMT * |
stmt | ) |
|
Initialize variable parameters
"If set to 1, causes mysql_stmt_store_result() to update the metadata MYSQL_FIELD->max_length value."
226 my_bool bool_tmp = 1;
227 mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &bool_tmp);
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
arena_t NULL
Definition: jemalloc_internal.h:624
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
PreparedStatement * m_stmt
Definition: PreparedStatement.h:140
uint32 m_paramCount
Definition: PreparedStatement.h:150
MYSQL_STMT * m_Mstmt
Definition: PreparedStatement.h:149
MySQLPreparedStatement::~MySQLPreparedStatement |
( |
| ) |
|
235 delete[]
m_Mstmt->bind->length;
236 delete[]
m_Mstmt->bind->is_null;
void ClearParameters()
Definition: PreparedStatement.cpp:242
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
MYSQL_STMT * m_Mstmt
Definition: PreparedStatement.h:149
bool MySQLPreparedStatement::CheckValidIndex |
( |
uint8 |
index | ) |
|
|
protected |
266 TC_LOG_WARN(
"sql.sql",
"[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).",
m_stmt->
m_index, index);
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
PreparedStatement * m_stmt
Definition: PreparedStatement.h:140
uint32 m_paramCount
Definition: PreparedStatement.h:150
uint32 m_index
Definition: PreparedStatement.h:104
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:204
#define ASSERT
Definition: Errors.h:55
static bool ParamenterIndexAssertFail(uint32 stmtIndex, uint8 index, uint32 paramCount)
Definition: PreparedStatement.cpp:254
void MySQLPreparedStatement::ClearParameters |
( |
| ) |
|
|
protected |
248 delete[] (
char*)
m_bind[i].buffer;
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
arena_t NULL
Definition: jemalloc_internal.h:624
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
uint32_t uint32
Definition: Define.h:150
uint32 m_paramCount
Definition: PreparedStatement.h:150
MYSQL_BIND* MySQLPreparedStatement::GetBind |
( |
| ) |
|
|
inlineprotected |
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
std::string MySQLPreparedStatement::getQueryString |
( |
std::string const & |
sqlPattern | ) |
const |
|
protected |
406 std::string queryString = sqlPattern;
411 pos = queryString.find(
'?', pos);
412 std::stringstream ss;
460 std::string replaceStr = ss.str();
461 queryString.replace(pos, 1, replaceStr);
462 pos += replaceStr.length();
Definition: PreparedStatement.h:55
Definition: PreparedStatement.h:51
int16_t int16
Definition: g3dmath.h:165
Definition: PreparedStatement.h:54
Definition: PreparedStatement.h:47
PreparedStatement * m_stmt
Definition: PreparedStatement.h:140
Definition: PreparedStatement.h:56
Definition: PreparedStatement.h:58
uint16_t uint16
Definition: g3dmath.h:166
Definition: PreparedStatement.h:60
Definition: PreparedStatement.h:52
std::vector< PreparedStatementData > statement_data
Definition: PreparedStatement.h:105
uint32_t uint32
Definition: Define.h:150
Definition: PreparedStatement.h:49
Definition: PreparedStatement.h:53
Definition: PreparedStatement.h:48
Definition: PreparedStatement.h:50
Definition: PreparedStatement.h:57
Definition: PreparedStatement.h:59
MYSQL_STMT* MySQLPreparedStatement::GetSTMT |
( |
| ) |
|
|
inlineprotected |
MYSQL_STMT * m_Mstmt
Definition: PreparedStatement.h:149
359 MYSQL_BIND* param = &
m_bind[index];
361 param->buffer_type = MYSQL_TYPE_BLOB;
362 delete []
static_cast<char *
>(param->buffer);
363 param->buffer =
new char[len];
364 param->buffer_length = len;
365 param->is_null_value = 0;
366 delete param->length;
367 param->length =
new unsigned long(len);
371 param->buffer_type = MYSQL_TYPE_VAR_STRING;
374 memcpy(param->buffer, value.data(), len);
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
uint32_t uint32
Definition: Define.h:150
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
uint32_t uint32
Definition: g3dmath.h:168
void setUInt8(const uint8 index, const uint8 value)
Definition: PreparedStatement.cpp:275
const FieldDescriptor value
Definition: descriptor.h:1522
void MySQLPreparedStatement::setDouble |
( |
const uint8 |
index, |
|
|
const double |
value |
|
) |
| |
351 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
void MySQLPreparedStatement::setFloat |
( |
const uint8 |
index, |
|
|
const float |
value |
|
) |
| |
343 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
319 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
int16_t int16
Definition: Define.h:147
327 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
int32_t int32
Definition: Define.h:146
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
335 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
int64_t int64
Definition: Define.h:145
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
311 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
int8_t int8
Definition: Define.h:148
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
void MySQLPreparedStatement::setNull |
( |
const uint8 |
index | ) |
|
381 MYSQL_BIND* param = &
m_bind[index];
382 param->buffer_type = MYSQL_TYPE_NULL;
383 delete []
static_cast<char *
>(param->buffer);
384 param->buffer =
NULL;
385 param->buffer_length = 0;
386 param->is_null_value = 1;
387 delete param->length;
388 param->length =
NULL;
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
arena_t NULL
Definition: jemalloc_internal.h:624
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
287 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
uint16_t uint16
Definition: Define.h:151
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
295 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
uint32_t uint32
Definition: Define.h:150
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
303 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
uint64_t uint64
Definition: Define.h:149
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
279 MYSQL_BIND* param = &
m_bind[index];
std::vector< bool > m_paramsSet
Definition: PreparedStatement.h:151
MYSQL_BIND * m_bind
Definition: PreparedStatement.h:152
void setValue(MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)
Definition: PreparedStatement.cpp:391
uint8_t uint8
Definition: Define.h:152
bool CheckValidIndex(uint8 index)
Definition: PreparedStatement.cpp:261
const FieldDescriptor value
Definition: descriptor.h:1522
void MySQLPreparedStatement::setValue |
( |
MYSQL_BIND * |
param, |
|
|
enum_field_types |
type, |
|
|
const void * |
value, |
|
|
uint32 |
len, |
|
|
bool |
isUnsigned |
|
) |
| |
|
private |
393 param->buffer_type = type;
394 delete []
static_cast<char *
>(param->buffer);
395 param->buffer =
new char[len];
396 param->buffer_length = 0;
397 param->is_null_value = 0;
398 param->length =
NULL;
399 param->is_unsigned = isUnsigned;
401 memcpy(param->buffer,
value, len);
arena_t NULL
Definition: jemalloc_internal.h:624
const FieldDescriptor value
Definition: descriptor.h:1522
friend class MySQLConnection |
|
friend |
MYSQL_BIND* MySQLPreparedStatement::m_bind |
|
private |
MYSQL_STMT* MySQLPreparedStatement::m_Mstmt |
|
private |
uint32 MySQLPreparedStatement::m_paramCount |
|
private |
std::vector<bool> MySQLPreparedStatement::m_paramsSet |
|
private |
The documentation for this class was generated from the following files: