mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
From: Michael Meskes <Michael.Meskes@usa.net>
See attached file. Now accepts "exec sql whenever sqlwarning".
This commit is contained 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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user