aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/lib
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1999-01-21 20:01:34 +0000
committerMarc G. Fournier <scrappy@hub.org>1999-01-21 20:01:34 +0000
commitcdbaec771c5c0b77a4a130a3726e6ea043c59eed (patch)
treebe07e5b884c1929d287c2166e774f2ba94c8c8f3 /src/interfaces/ecpg/lib
parent1f37905681dc3f068a2690b21a7162df145c4690 (diff)
downloadpostgresql-cdbaec771c5c0b77a4a130a3726e6ea043c59eed.tar.gz
postgresql-cdbaec771c5c0b77a4a130a3726e6ea043c59eed.zip
From: Michael Meskes <Michael.Meskes@usa.net>
See attached file. Now accepts "exec sql whenever sqlwarning".
Diffstat (limited to 'src/interfaces/ecpg/lib')
-rw-r--r--src/interfaces/ecpg/lib/Makefile.in4
-rw-r--r--src/interfaces/ecpg/lib/ecpglib.c13
2 files changed, 11 insertions, 6 deletions
diff --git a/src/interfaces/ecpg/lib/Makefile.in b/src/interfaces/ecpg/lib/Makefile.in
index 182fd657432..9173f36c4ee 100644
--- a/src/interfaces/ecpg/lib/Makefile.in
+++ b/src/interfaces/ecpg/lib/Makefile.in
@@ -6,13 +6,13 @@
# Copyright (c) 1994, Regents of the University of California
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.39 1999/01/17 06:19:24 momjian Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.40 1999/01/21 20:01:32 scrappy Exp $
#
#-------------------------------------------------------------------------
NAME= ecpg
SO_MAJOR_VERSION= 2
-SO_MINOR_VERSION= 6.2
+SO_MINOR_VERSION= 6.3
SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global
diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c
index f982d5103cb..62769941a7c 100644
--- a/src/interfaces/ecpg/lib/ecpglib.c
+++ b/src/interfaces/ecpg/lib/ecpglib.c
@@ -886,12 +886,17 @@ ECPGtrans(int lineno, const char *transaction)
PGresult *res;
ECPGlog("ECPGtrans line %d action = %s\n", lineno, transaction);
- if ((res = PQexec(actual_connection->connection, transaction)) == NULL)
+
+ /* if we have no connection we just simulate the command */
+ if (actual_connection && actual_connection->connection)
{
- register_error(ECPG_TRANS, "Error in transaction processing line %d.", lineno);
- return FALSE;
+ if ((res = PQexec(actual_connection->connection, transaction)) == NULL)
+ {
+ register_error(ECPG_TRANS, "Error in transaction processing line %d.", lineno);
+ return FALSE;
+ }
+ PQclear(res);
}
- PQclear(res);
if (strcmp(transaction, "commit") == 0 || strcmp(transaction, "rollback") == 0)
committed = 1;
return TRUE;