diff options
author | Michael Meskes <meskes@postgresql.org> | 2010-10-14 17:55:07 +0200 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2010-10-14 17:55:07 +0200 |
commit | 816b008eaf1a1ff1069f3bafff363a9a8bf04a21 (patch) | |
tree | 2785ed9cfac2e7f1ec34222fe688aff9ab776d4d /src/interfaces/ecpg/ecpglib/execute.c | |
parent | 1a996d6c2972b343d8ec446d1c7c4c5fa8e19ef4 (diff) | |
download | postgresql-816b008eaf1a1ff1069f3bafff363a9a8bf04a21.tar.gz postgresql-816b008eaf1a1ff1069f3bafff363a9a8bf04a21.zip |
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.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/execute.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/execute.c | 3 |
1 files changed, 1 insertions, 2 deletions
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); |