aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/lib
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2002-01-18 15:51:00 +0000
committerMichael Meskes <meskes@postgresql.org>2002-01-18 15:51:00 +0000
commit2ab3a8887972d5e63ec33856a513e9f3b4b21dbb (patch)
tree1642b6088c0969f270d659350b8d50b2e3f8b020 /src/interfaces/ecpg/lib
parent85bc36158d4af941d5f0a836ac0ecaa158211c82 (diff)
downloadpostgresql-2ab3a8887972d5e63ec33856a513e9f3b4b21dbb.tar.gz
postgresql-2ab3a8887972d5e63ec33856a513e9f3b4b21dbb.zip
Accept subsequent commits. This should have been just a warning anyway. I
cannot see a reason why it should be an error.
Diffstat (limited to 'src/interfaces/ecpg/lib')
-rw-r--r--src/interfaces/ecpg/lib/misc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/lib/misc.c b/src/interfaces/ecpg/lib/misc.c
index a3dd727cbd6..4a5573b649b 100644
--- a/src/interfaces/ecpg/lib/misc.c
+++ b/src/interfaces/ecpg/lib/misc.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/misc.c,v 1.11 2001/12/23 12:17:41 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/misc.c,v 1.12 2002/01/18 15:51:00 meskes Exp $ */
#include "postgres_fe.h"
@@ -90,12 +90,17 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
/* if we have no connection we just simulate the command */
if (con && con->connection)
{
- if ((res = PQexec(con->connection, transaction)) == NULL)
+ /* if we are not in autocommit mode, already have committed
+ * the transaction and get another commit, just ignore it */
+ if (!con->committed || con->autocommit)
{
- ECPGraise(lineno, ECPG_TRANS, NULL);
- return FALSE;
+ if ((res = PQexec(con->connection, transaction)) == NULL)
+ {
+ ECPGraise(lineno, ECPG_TRANS, NULL);
+ return FALSE;
+ }
+ PQclear(res);
}
- PQclear(res);
}
if (strcmp(transaction, "commit") == 0 || strcmp(transaction, "rollback") == 0)