Applied patch by Itagaki Takahiro to fix incorrect status calculation in
authorMichael Meskes <[email protected]>
Thu, 14 Oct 2010 15:51:53 +0000 (17:51 +0200)
committerMichael Meskes <[email protected]>
Thu, 14 Oct 2010 15:51:53 +0000 (17:51 +0200)
ecpglib. Instead of parsing the statement just as ask the database server.

src/interfaces/ecpg/ecpglib/misc.c

index d7a80d5f25bb298c3401a582ad451364fd1c54dd..daf01e6b9e0bc75f43b7b0f5f3bb4a55f3706b52 100644 (file)
@@ -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;
 }