From: Michael Meskes
authorMarc G. Fournier
Sun, 21 Feb 1999 03:02:35 +0000 (03:02 +0000)
committerMarc G. Fournier
Sun, 21 Feb 1999 03:02:35 +0000 (03:02 +0000)
+
+ Fri Feb 19 21:40:14 CET 1999
+
+       - Fixed bug in libecpg that caused it to start transactions only for
+         the first connection.
+       - Set library version to 2.7.1

src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/lib/Makefile.in
src/interfaces/ecpg/lib/ecpglib.c

index 196f7c99e5e7c8e87db5b12349c494e892666eb1..eac1b96e800be28b24089337e69206261b410771 100644 (file)
@@ -457,3 +457,9 @@ Fri Feb 19 18:38:45 CET 1999
 
    - Finished type aliasing for structures.
    - Set ecpg version to 2.5.0
+
+Fri Feb 19 21:40:14 CET 1999
+
+   - Fixed bug in libecpg that caused it to start transactions only for
+     the first connection.
+   - Set library version to 2.7.1
index 195ded19680d0c6b13ddea6c442cab17564835e9..4872e8c0fd5ae229f9e4563f852ff21e18719de0 100644 (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.41 1999/02/20 07:00:53 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.42 1999/02/21 03:02:35 scrappy Exp $
 #
 #-------------------------------------------------------------------------
 
 NAME= ecpg
 SO_MAJOR_VERSION= 2
-SO_MINOR_VERSION= 7.0
+SO_MINOR_VERSION= 7.1
 
 SRCDIR= @top_srcdir@
 include $(SRCDIR)/Makefile.global
index 01fe37298bbb586916cc3824498b4e9dd24f597e..2a7745f2a6747067cd84ab9ab8781d4ec72a2228 100644 (file)
@@ -53,10 +53,11 @@ struct sqlca sqlca =
 
 static struct connection
 {
-   char       *name;
-   PGconn     *connection;
+   char    *name;
+   PGconn  *connection;
+   int committed;
    struct connection *next;
-}         *all_connections = NULL, *actual_connection = NULL;
+}      *all_connections = NULL, *actual_connection = NULL;
 
 struct variable
 {
@@ -90,7 +91,6 @@ struct prepared_statement
 
 static int simple_debug = 0;
 static FILE *debugstream = NULL;
-static int committed = true;
 
 static void
 register_error(long code, char *fmt,...)
@@ -564,7 +564,7 @@ ECPGexecute(struct statement * stmt)
 
    /* Now the request is built. */
 
-   if (committed && !no_auto_trans)
+   if (actual_connection->committed && !no_auto_trans)
    {
        if ((results = PQexec(actual_connection->connection, "begin transaction")) == NULL)
        {
@@ -572,7 +572,7 @@ ECPGexecute(struct statement * stmt)
            return false;
        }
        PQclear(results);
-       committed = 0;
+       actual_connection->committed = false;
    }
 
    ECPGlog("ECPGexecute line %d: QUERY: %s\n", stmt->lineno, copiedquery);
@@ -987,7 +987,7 @@ ECPGtrans(int lineno, const char *transaction)
    {
        struct prepared_statement *this;
            
-       committed = 1;
+       actual_connection->committed = true;
 
        /* deallocate all prepared statements */
        for (this = prep_stmts; this != NULL; this = this->next)
@@ -999,7 +999,7 @@ ECPGtrans(int lineno, const char *transaction)
        }
    }
 
-   return TRUE;
+   return true;
 }
 
 bool
@@ -1059,6 +1059,8 @@ ECPGconnect(int lineno, const char *dbname, const char *user, const char *passwd
        register_error(ECPG_CONNECT, "connect: could not open database %s.", dbname ? dbname : "NULL");
        return false;
    }
+   
+   this->committed = true;
 
    return true;
 }