From 816b008eaf1a1ff1069f3bafff363a9a8bf04a21 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Thu, 14 Oct 2010 17:55:07 +0200 Subject: Applied patch by Itagaki Takahiro to fix incorrect status calculation in ecpglib. Instead of parsing the statement just as ask the database server. This patch removes the whole client side track keeping of the current transaction status. --- src/interfaces/ecpg/ecpglib/execute.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/interfaces/ecpg/ecpglib/execute.c') diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 817724abe68..970fa935099 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1427,7 +1427,7 @@ ecpg_execute(struct statement * stmt) /* The request has been build. */ - if (stmt->connection->committed && !stmt->connection->autocommit) + if (PQtransactionStatus(stmt->connection->connection) == PQTRANS_IDLE && !stmt->connection->autocommit) { results = PQexec(stmt->connection->connection, "begin transaction"); if (!ecpg_check_PQresult(results, stmt->lineno, stmt->connection->connection, stmt->compat)) @@ -1436,7 +1436,6 @@ ecpg_execute(struct statement * stmt) return false; } PQclear(results); - stmt->connection->committed = false; } ecpg_log("ecpg_execute on line %d: query: %s; with %d parameter(s) on connection %s\n", stmt->lineno, stmt->command, nParams, stmt->connection->name); -- cgit v1.2.3