mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 05:01:29 +00:00
Fixed bug with ErrorBuffer being overwritten on non query requests
This commit is contained in:
parent
321cf17eac
commit
f1b8908c9a
@ -10,35 +10,24 @@ MySQLRequestResult::MySQLRequestResult()
|
||||
MySQLRequestResult::MySQLRequestResult(MYSQL_RES* result, uint32 rowsAffected, uint32 rowCount, uint32 columnCount, uint32 lastInsertedID, uint32 errorNumber, char *errorBuffer)
|
||||
: m_CurrentRow(result), m_OneBeyondRow()
|
||||
{
|
||||
if (errorBuffer != nullptr)
|
||||
m_Success = false;
|
||||
else if (errorBuffer == nullptr && result == nullptr)
|
||||
{
|
||||
m_Success = false;
|
||||
|
||||
#ifdef _EQDEBUG
|
||||
std::cout << "DB Query Error: No Result" << std::endl;
|
||||
#endif
|
||||
m_ErrorNumber = UINT_MAX;
|
||||
m_ErrorBuffer = new char[MYSQL_ERRMSG_SIZE];
|
||||
|
||||
strcpy(m_ErrorBuffer, "DBcore::RunQuery: No Result");
|
||||
}
|
||||
else
|
||||
m_Success = true;
|
||||
|
||||
m_Result = result;
|
||||
m_ErrorBuffer = errorBuffer;
|
||||
m_RowsAffected = rowsAffected;
|
||||
m_RowCount = rowCount;
|
||||
m_ColumnCount = columnCount;
|
||||
m_LastInsertedID = lastInsertedID;
|
||||
|
||||
// If we actually need the column length / fields it will be
|
||||
// requested at that time, no need to pull it in just to cache it.
|
||||
// Normal usage would have it as nullptr most likely anyways.
|
||||
m_ColumnLengths = nullptr;
|
||||
m_Fields = nullptr;
|
||||
m_LastInsertedID = lastInsertedID;
|
||||
|
||||
if (errorBuffer != nullptr)
|
||||
m_Success = false;
|
||||
|
||||
m_Success = true;
|
||||
m_ErrorNumber = errorNumber;
|
||||
m_ErrorBuffer = errorBuffer;
|
||||
}
|
||||
|
||||
void MySQLRequestResult::FreeInternals()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user