summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/lib/ecpglib.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>1999-03-24 20:05:15 +0000
committerMichael Meskes <meskes@postgresql.org>1999-03-24 20:05:15 +0000
commitd471f8073a51a7769efad581e017e7c0fd5e9e84 (patch)
tree28f4427a25b51960ec96e332c81dc975e678a3b9 /src/interfaces/ecpg/lib/ecpglib.c
parent9abf246b915ea4892a5c1bbc33f38bdf584cf165 (diff)
*** empty log message ***
Diffstat (limited to 'src/interfaces/ecpg/lib/ecpglib.c')
-rw-r--r--src/interfaces/ecpg/lib/ecpglib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c
index 4d13f6dcb1c..28ef35f69ed 100644
--- a/src/interfaces/ecpg/lib/ecpglib.c
+++ b/src/interfaces/ecpg/lib/ecpglib.c
@@ -26,8 +26,6 @@
#include <sqlca.h>
/* variables visible to the programs */
-int no_auto_trans;
-
static struct sqlca sqlca_init =
{
{'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '},
@@ -56,7 +54,8 @@ static struct connection
{
char *name;
PGconn *connection;
- int committed;
+ bool committed;
+ int no_auto_trans;
struct connection *next;
} *all_connections = NULL, *actual_connection = NULL;
@@ -633,7 +632,7 @@ ECPGexecute(struct statement * stmt)
/* Now the request is built. */
- if (stmt->connection->committed && !no_auto_trans)
+ if (stmt->connection->committed && !stmt->connection->no_auto_trans)
{
if ((results = PQexec(stmt->connection->connection, "begin transaction")) == NULL)
{
@@ -1144,7 +1143,7 @@ ECPGsetconn(int lineno, const char *connection_name)
}
bool
-ECPGconnect(int lineno, const char *dbname, const char *user, const char *passwd, const char *connection_name)
+ECPGconnect(int lineno, const char *dbname, const char *user, const char *passwd, const char *connection_name, int no_auto_trans)
{
struct connection *this = (struct connection *) ecpg_alloc(sizeof(struct connection), lineno);
@@ -1182,6 +1181,7 @@ ECPGconnect(int lineno, const char *dbname, const char *user, const char *passwd
}
this->committed = true;
+ this->no_auto_trans = no_auto_trans;
return true;
}