aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Database/QueryResultMysql.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/Database/QueryResultMysql.cpp')
-rw-r--r--src/shared/Database/QueryResultMysql.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/shared/Database/QueryResultMysql.cpp b/src/shared/Database/QueryResultMysql.cpp
index 2e4738469c9..ef8a77ec002 100644
--- a/src/shared/Database/QueryResultMysql.cpp
+++ b/src/shared/Database/QueryResultMysql.cpp
@@ -17,47 +17,35 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#ifndef DO_POSTGRESQL
-
#include "DatabaseEnv.h"
-
QueryResultMysql::QueryResultMysql(MYSQL_RES *result, MYSQL_FIELD *fields, uint64 rowCount, uint32 fieldCount) :
QueryResult(rowCount, fieldCount), mResult(result)
{
-
mCurrentRow = new Field[mFieldCount];
ASSERT(mCurrentRow);
-
for (uint32 i = 0; i < mFieldCount; i++)
mCurrentRow[i].SetType(ConvertNativeType(fields[i].type));
}
-
QueryResultMysql::~QueryResultMysql()
{
EndQuery();
}
-
bool QueryResultMysql::NextRow()
{
MYSQL_ROW row;
-
if (!mResult)
return false;
-
row = mysql_fetch_row(mResult);
if (!row)
{
EndQuery();
return false;
}
-
for (uint32 i = 0; i < mFieldCount; i++)
mCurrentRow[i].SetValue(row[i]);
-
return true;
}
-
void QueryResultMysql::EndQuery()
{
if (mCurrentRow)
@@ -65,14 +53,12 @@ void QueryResultMysql::EndQuery()
delete [] mCurrentRow;
mCurrentRow = 0;
}
-
if (mResult)
{
mysql_free_result(mResult);
mResult = 0;
}
}
-
enum Field::DataTypes QueryResultMysql::ConvertNativeType(enum_field_types mysqlType) const
{
switch (mysqlType)
@@ -89,7 +75,6 @@ enum Field::DataTypes QueryResultMysql::ConvertNativeType(enum_field_types mysql
case FIELD_TYPE_NULL:
return Field::DB_TYPE_STRING;
case FIELD_TYPE_TINY:
-
case FIELD_TYPE_SHORT:
case FIELD_TYPE_LONG:
case FIELD_TYPE_INT24: