From 5242a86e2fe27815a0cb799b08a9ae082b711abd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 10 Feb 2014 10:25:12 +0100 Subject: [PATCH] Fix: PostgreSQL's GetAffectedRows() function always returned 0. Fixes #5628 --- components/db_ido_pgsql/idopgsqlconnection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/db_ido_pgsql/idopgsqlconnection.cpp b/components/db_ido_pgsql/idopgsqlconnection.cpp index 936daa898..2d0188ad5 100644 --- a/components/db_ido_pgsql/idopgsqlconnection.cpp +++ b/components/db_ido_pgsql/idopgsqlconnection.cpp @@ -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)); }