mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
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)
|
||||
);
|
||||
|
||||
char *rowCount = PQcmdTuples(result);
|
||||
m_AffectedRows = atoi(rowCount);
|
||||
|
||||
if (PQresultStatus(result) == PGRES_COMMAND_OK)
|
||||
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));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user