Skip to content

Commit 86d4cc4

Browse files
author
Michael Meskes
committed
Applied patch by Itagaki Takahiro to fix incorrect status calculation in
ecpglib. Instead of parsing the statement just as ask the database server.
1 parent ef76230 commit 86d4cc4

File tree

1 file changed

+1
-4
lines changed
  • src/interfaces/ecpg/ecpglib

1 file changed

+1
-4
lines changed

src/interfaces/ecpg/ecpglib/misc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
219219
return FALSE;
220220
PQclear(res);
221221

222-
if (strncmp(transaction, "commit", 6) == 0 || strncmp(transaction, "rollback", 8) == 0)
223-
con->committed = true;
224-
else
225-
con->committed = false;
222+
con->committed = (PQtransactionStatus(con->connection) == PQTRANS_IDLE);
226223
}
227224

228225
return true;

0 commit comments

Comments
 (0)