]> granicus.if.org Git - icinga2/commitdiff
Fix incorrect value for IdoMysqlConnection::m_AffectedRows
authorGunnar Beutner <gunnar@beutner.name>
Mon, 28 Sep 2015 11:19:13 +0000 (13:19 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 28 Sep 2015 11:19:42 +0000 (13:19 +0200)
refs #10190

lib/db_ido/dbconnection.cpp
lib/db_ido_mysql/idomysqlconnection.cpp

index ad7153f11fdd1dfecd725e9bc169db249ab611dd..4c73b26bfaf47260619acc4b18b58d16df3d2034 100644 (file)
@@ -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");
index c04e374d950e3002b1bdf4e1e961132a004277c6..8e2dbd2f39ee0b80c112167f902e23ec0318ce77 100644 (file)
@@ -442,9 +442,9 @@ void IdoMysqlConnection::FinishAsyncQueries(bool force)
                for (std::vector<IdoAsyncQuery>::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) {