diff options
author | Michael Meskes <meskes@postgresql.org> | 2010-10-14 17:51:53 +0200 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2010-10-14 17:51:53 +0200 |
commit | a0e02dc1af7142fe1a4ee68c8f635aa3f84cc8b7 (patch) | |
tree | 6abc2d073f37a472097833a4f4e542cb2521ebe3 /src/interfaces/ecpg/ecpglib/misc.c | |
parent | 9dfd3086431b594f26026b7cfb91f56195aa30d7 (diff) | |
download | postgresql-a0e02dc1af7142fe1a4ee68c8f635aa3f84cc8b7.tar.gz postgresql-a0e02dc1af7142fe1a4ee68c8f635aa3f84cc8b7.zip |
Applied patch by Itagaki Takahiro to fix incorrect status calculation in
ecpglib. Instead of parsing the statement just as ask the database server.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/misc.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/misc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index d7a80d5f25b..daf01e6b9e0 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -204,10 +204,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction) PQclear(res); } - if (strncmp(transaction, "commit", 6) == 0 || strncmp(transaction, "rollback", 8) == 0) - con->committed = true; - else - con->committed = false; + con->committed = (PQtransactionStatus(con->connection) == PQTRANS_IDLE); return true; } |