diff options
author | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2016-04-21 10:59:36 +0100 |
---|---|---|
committer | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2016-04-21 10:59:36 +0100 |
commit | afcde49538230d4f8648e227f8a861b5a1b9a83c (patch) | |
tree | 4f6ea35c9c5025a2db6647fa49272e5a3b4e57b4 /libpqpp/pq-selectcommand.cpp | |
parent | Actually, don't prepare statement upfront during construction as it might not... (diff) | |
download | libdbpp-postgresql-afcde49538230d4f8648e227f8a861b5a1b9a83c.tar.bz2 libdbpp-postgresql-afcde49538230d4f8648e227f8a861b5a1b9a83c.tar.xz libdbpp-postgresql-afcde49538230d4f8648e227f8a861b5a1b9a83c.zip |
Don't attempt to close cursors when in failed transaction (it's failed and result in sigabrt)
Diffstat (limited to 'libpqpp/pq-selectcommand.cpp')
-rw-r--r-- | libpqpp/pq-selectcommand.cpp | 2 |
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) { |