diff options
author | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
commit | 26b5e033ffde3d161382fc9addbfa99738379641 (patch) | |
tree | a344f369ca32945f787a02dee35c3dbe342bed7e /src/shared/Database/QueryResultMysql.cpp | |
parent | f21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff) |
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget
--HG--
branch : trunk
Diffstat (limited to 'src/shared/Database/QueryResultMysql.cpp')
-rw-r--r-- | src/shared/Database/QueryResultMysql.cpp | 15 |
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: |