mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user