1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-22 12:22:45 +03:00
See attached file. Now accepts "exec sql whenever sqlwarning".
This commit is contained in:
Marc G. Fournier
1999-01-21 20:01:34 +00:00
parent 1f37905681
commit cdbaec771c
6 changed files with 51 additions and 18 deletions

View File

@@ -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

View File

@@ -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;