48 if (
m_stmt->bind_result_done)
50 delete[]
m_stmt->bind->length;
51 delete[]
m_stmt->bind->is_null;
63 if (mysql_stmt_store_result(
m_stmt))
65 TC_LOG_WARN(
"sql.sql",
"%s:mysql_stmt_store_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(
m_stmt));
76 std::size_t rowSize = 0;
82 m_rBind[i].buffer_type = field[i].type;
83 m_rBind[i].buffer_length = size;
87 m_rBind[i].is_unsigned = field[i].flags & UNSIGNED_FLAG;
90 char* dataBuffer =
new char[rowSize *
m_rowCount];
93 m_rBind[i].buffer = dataBuffer + offset;
94 offset +=
m_rBind[i].buffer_length;
100 TC_LOG_WARN(
"sql.sql",
"%s:mysql_stmt_bind_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(
m_stmt));
101 mysql_stmt_free_result(
m_stmt);
113 unsigned long buffer_length =
m_rBind[fIndex].buffer_length;
114 unsigned long fetched_length = *
m_rBind[fIndex].length;
117 void* buffer =
m_stmt->bind[fIndex].buffer;
118 switch (
m_rBind[fIndex].buffer_type)
120 case MYSQL_TYPE_TINY_BLOB:
121 case MYSQL_TYPE_MEDIUM_BLOB:
122 case MYSQL_TYPE_LONG_BLOB:
123 case MYSQL_TYPE_BLOB:
124 case MYSQL_TYPE_STRING:
125 case MYSQL_TYPE_VAR_STRING:
131 if (fetched_length < buffer_length)
132 *((
char*)buffer + fetched_length) =
'\0';
144 m_stmt->bind[fIndex].buffer = (
char*)buffer + rowSize;
163 mysql_stmt_free_result(
m_stmt);
uint32 m_fieldCount
Definition: QueryResult.h:90
unsigned long * m_length
Definition: QueryResult.h:98
arena_t NULL
Definition: jemalloc_internal.h:624
void CleanUp()
Definition: QueryResult.cpp:240
MYSQL_RES * m_metadataResult
Field metadata, returned by mysql_stmt_result_metadata.
Definition: QueryResult.h:95
std::vector< Field > m_rows
Definition: QueryResult.h:87
MYSQL_BIND * m_rBind
Definition: QueryResult.h:93
my_bool * m_isNull
Definition: QueryResult.h:97
uint64 m_rowPosition
Definition: QueryResult.h:89
uint32_t uint32
Definition: Define.h:150
float length(float v)
Definition: vectorMath.h:208
MYSQL_STMT * m_stmt
Definition: QueryResult.h:94
uint64 m_rowCount
Definition: QueryResult.h:88
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:204
uint32_t uint32
Definition: g3dmath.h:168
static uint32 SizeForType(MYSQL_FIELD *field)
Definition: Field.h:336
bool _NextRow()
Definition: QueryResult.cpp:214