]> granicus.if.org Git - postgresql/commitdiff
Applied patch by Itagaki Takahiro to fix incorrect status calculation in
authorMichael Meskes <meskes@postgresql.org>
Thu, 14 Oct 2010 15:49:01 +0000 (17:49 +0200)
committerMichael Meskes <meskes@postgresql.org>
Thu, 14 Oct 2010 15:49:01 +0000 (17:49 +0200)
ecpglib. Instead of parsing the statement just as ask the database server.

src/interfaces/ecpg/ecpglib/misc.c

index 9a5dca763bd5eb4d408dbbe4fbad491de5ac1cc3..5c1696ad8286d8c3839bc9d3d8e83d4ae561b1ff 100644 (file)
@@ -219,10 +219,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
                        return FALSE;
                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;