mirror of https://github.com/Icinga/icinga2.git
Fix: PostgreSQL's GetAffectedRows() function always returned 0.
Fixes #5628
This commit is contained in:
parent
663f72300b
commit
5242a86e2f
|
@ -255,6 +255,9 @@ IdoPgsqlResult IdoPgsqlConnection::Query(const String& query)
|
||||||
<< errinfo_database_query(query)
|
<< errinfo_database_query(query)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
char *rowCount = PQcmdTuples(result);
|
||||||
|
m_AffectedRows = atoi(rowCount);
|
||||||
|
|
||||||
if (PQresultStatus(result) == PGRES_COMMAND_OK)
|
if (PQresultStatus(result) == PGRES_COMMAND_OK)
|
||||||
return IdoPgsqlResult();
|
return IdoPgsqlResult();
|
||||||
|
|
||||||
|
@ -269,9 +272,6 @@ IdoPgsqlResult IdoPgsqlConnection::Query(const String& query)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *rowCount = PQcmdTuples(result);
|
|
||||||
m_AffectedRows = atoi(rowCount);
|
|
||||||
|
|
||||||
return IdoPgsqlResult(result, std::ptr_fun(PQclear));
|
return IdoPgsqlResult(result, std::ptr_fun(PQclear));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue