From: Michael Meskes Date: Thu, 14 Oct 2010 15:51:53 +0000 (+0200) Subject: Applied patch by Itagaki Takahiro to fix incorrect status calculation in X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=a0e02dc1af7142fe1a4ee68c8f635aa3f84cc8b7;p=users%2Fc2main%2Fpostgres.git Applied patch by Itagaki Takahiro to fix incorrect status calculation in ecpglib. Instead of parsing the statement just as ask the database server. --- diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index d7a80d5f25..daf01e6b9e 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; }