[7935] Move seldom used access to query data by field names to independent object.

This let not do preparation code for unused later functionlity.
This commit is contained in:
VladimirMangos 2009-06-01 10:20:28 +04:00
parent 626553c9ee
commit c3c7187841
12 changed files with 165 additions and 71 deletions

View file

@ -20,20 +20,15 @@
#include "DatabaseEnv.h"
QueryResultMysql::QueryResultMysql(MYSQL_RES *result, uint64 rowCount, uint32 fieldCount) :
QueryResult(rowCount, fieldCount), mResult(result)
QueryResultMysql::QueryResultMysql(MYSQL_RES *result, MYSQL_FIELD *fields, uint64 rowCount, uint32 fieldCount) :
QueryResult(rowCount, fieldCount), mResult(result)
{
mCurrentRow = new Field[mFieldCount];
ASSERT(mCurrentRow);
MYSQL_FIELD *fields = mysql_fetch_fields(mResult);
for (uint32 i = 0; i < mFieldCount; i++)
{
mFieldNames[i] = fields[i].name;
mCurrentRow[i].SetType(ConvertNativeType(fields[i].type));
}
}
QueryResultMysql::~QueryResultMysql()