From 2631861370e7cc4830d53cc21ba84fe0c02827f4 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Sun, 26 May 2013 20:32:54 -0700 Subject: [PATCH] be sure to get the actual size of the query. --- common/dbcore.cpp | 2 +- common/shareddb.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index bd03e6535..c68d5d3eb 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -74,7 +74,7 @@ bool DBcore::RunQuery(const std::string query, char* errbuf, MYSQL_RES** result, strn0cpy(tmp, query.c_str(), sizeof(tmp)); std::cout << "QUERY: " << tmp << std::endl; #endif - if (mysql_real_query(&mysql, query.c_str(), query.length())) { + if (mysql_real_query(&mysql, query.c_str(), strlen(query.c_str()))) { if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR) pStatus = Error; if (mysql_errno(&mysql) == CR_SERVER_LOST || mysql_errno(&mysql) == CR_SERVER_GONE_ERROR) { diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 85be4d3dd..f9229728c 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1603,6 +1603,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe StringFormat(query,"SELECT `spellid`, `type` from `damageshieldtypes` " "WHERE `spellid` > 0 AND `spellid` <= %i", iMaxSpellID); + if(RunQuery(query,errbuf,&result)) { while((row = mysql_fetch_row(result))) {