summaryrefslogtreecommitdiff
path: root/libpqpp/pq-selectcommand.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <daniel.goodliffe@pressassociation.com>2016-04-21 10:59:36 +0100
committerDan Goodliffe <daniel.goodliffe@pressassociation.com>2016-04-21 10:59:36 +0100
commite52b3dccf14a7606b5a19bcd1a763a377b59e873 (patch)
tree8a2959729b63cac79355e8e26f1d16f9c270ed85 /libpqpp/pq-selectcommand.cpp
parentActually, don't prepare statement upfront during construction as it might not... (diff)
downloadlibdbpp-postgresql-e52b3dccf14a7606b5a19bcd1a763a377b59e873.tar.bz2
libdbpp-postgresql-e52b3dccf14a7606b5a19bcd1a763a377b59e873.tar.xz
libdbpp-postgresql-e52b3dccf14a7606b5a19bcd1a763a377b59e873.zip
Don't attempt to close cursors when in failed transaction (it's failed and result in sigabrt)libdbpp-postgresql-1.0.4
Diffstat (limited to 'libpqpp/pq-selectcommand.cpp')
-rw-r--r--libpqpp/pq-selectcommand.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpqpp/pq-selectcommand.cpp b/libpqpp/pq-selectcommand.cpp
index f8f44fd..b049eea 100644
--- a/libpqpp/pq-selectcommand.cpp
+++ b/libpqpp/pq-selectcommand.cpp
@@ -24,7 +24,7 @@ PQ::SelectCommand::~SelectCommand()
if (execRes) {
PQclear(execRes);
}
- if (executed) {
+ if (executed && PQtransactionStatus(c->conn) != PQTRANS_INERROR) {
c->checkResultFree((PQexec(c->conn, s_close.c_str())), PGRES_COMMAND_OK);
}
if (txOpened) {