mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-06 06:12:29 +00:00
Fixed bug with non row returning queries crashing.
This commit is contained in:
parent
e1e219ae97
commit
12ded4b506
@ -119,7 +119,10 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
|
|||||||
|
|
||||||
// successful query. get results.
|
// successful query. get results.
|
||||||
MYSQL_RES* res = mysql_store_result(&mysql);
|
MYSQL_RES* res = mysql_store_result(&mysql);
|
||||||
MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), (uint32)mysql_num_rows(res), (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql));
|
uint32 rowCount = 0;
|
||||||
|
if (res != nullptr)
|
||||||
|
rowCount = (uint32)mysql_num_rows(res);
|
||||||
|
MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), rowCount, (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql));
|
||||||
|
|
||||||
|
|
||||||
#if DEBUG_MYSQL_QUERIES >= 1
|
#if DEBUG_MYSQL_QUERIES >= 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user