From: Gunnar Beutner Date: Mon, 28 Sep 2015 11:19:13 +0000 (+0200) Subject: Fix incorrect value for IdoMysqlConnection::m_AffectedRows X-Git-Tag: v2.4.0~271 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d24af1e639dfcfd37d976a8993faad551aa194a0;p=icinga2 Fix incorrect value for IdoMysqlConnection::m_AffectedRows refs #10190 --- diff --git a/lib/db_ido/dbconnection.cpp b/lib/db_ido/dbconnection.cpp index ad7153f11..4c73b26bf 100644 --- a/lib/db_ido/dbconnection.cpp +++ b/lib/db_ido/dbconnection.cpp @@ -394,8 +394,8 @@ void DbConnection::PrepareDatabase(void) //ClearConfigTable("contactgroups"); //ClearConfigTable("contacts"); //ClearConfigTable("contactstatus"); - ClearConfigTable("customvariables"); - ClearConfigTable("customvariablestatus"); + //ClearConfigTable("customvariables"); + //ClearConfigTable("customvariablestatus"); //ClearConfigTable("endpoints"); //ClearConfigTable("endpointstatus"); ClearConfigTable("host_contactgroups"); diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp index c04e374d9..8e2dbd2f3 100644 --- a/lib/db_ido_mysql/idomysqlconnection.cpp +++ b/lib/db_ido_mysql/idomysqlconnection.cpp @@ -442,9 +442,9 @@ void IdoMysqlConnection::FinishAsyncQueries(bool force) for (std::vector::size_type i = offset; i < offset + count; i++) { const IdoAsyncQuery& aq = queries[i]; - m_AffectedRows = mysql_affected_rows(&m_Connection); + MYSQL_RES *result = mysql_store_result(&m_Connection); - MYSQL_RES *result = mysql_use_result(&m_Connection); + m_AffectedRows = mysql_affected_rows(&m_Connection); IdoMysqlResult iresult; @@ -510,9 +510,9 @@ IdoMysqlResult IdoMysqlConnection::Query(const String& query) ); } - m_AffectedRows = mysql_affected_rows(&m_Connection); + MYSQL_RES *result = mysql_store_result(&m_Connection); - MYSQL_RES *result = mysql_use_result(&m_Connection); + m_AffectedRows = mysql_affected_rows(&m_Connection); if (!result) { if (mysql_field_count(&m_Connection) > 0) {