Skip to content

Commit fe35c8e

Browse files
author
Michael Meskes
committed
Do not set connection values if no connection is open.
1 parent 49d960c commit fe35c8e

File tree

1 file changed

+6
-6
lines changed
  • src/interfaces/ecpg/ecpglib

1 file changed

+6
-6
lines changed

src/interfaces/ecpg/ecpglib/misc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.50 2009/08/07 10:51:20 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.51 2009/09/03 09:09:01 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -202,12 +202,12 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
202202
if (!ecpg_check_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
203203
return FALSE;
204204
PQclear(res);
205-
}
206205

207-
if (strncmp(transaction, "commit", 6) == 0 || strncmp(transaction, "rollback", 8) == 0)
208-
con->committed = true;
209-
else
210-
con->committed = false;
206+
if (strncmp(transaction, "commit", 6) == 0 || strncmp(transaction, "rollback", 8) == 0)
207+
con->committed = true;
208+
else
209+
con->committed = false;
210+
}
211211

212212
return true;
213213
}

0 commit comments

Comments
 (0)