aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/misc.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2007-08-14 10:01:54 +0000
committerMichael Meskes <meskes@postgresql.org>2007-08-14 10:01:54 +0000
commit635a0b9a8640bb7f2944a3f77ddc370f8dd7b010 (patch)
treed54146b2416fecd2a544f3bf786108079b879cfc /src/interfaces/ecpg/ecpglib/misc.c
parentb83bd31bd953b6daa22bcbdaee5ade2a27ec7324 (diff)
downloadpostgresql-635a0b9a8640bb7f2944a3f77ddc370f8dd7b010.tar.gz
postgresql-635a0b9a8640bb7f2944a3f77ddc370f8dd7b010.zip
- Finished major rewrite to use new protocol version
- Really prepare statements - Added more regression tests - Added auto-prepare mode - Use '$n' for positional variables, '?' is still possible via ecpg option - Cleaned up the sources a little bit
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/misc.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/misc.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c
index 47d924fac86..1da37ec5f77 100644
--- a/src/interfaces/ecpg/ecpglib/misc.c
+++ b/src/interfaces/ecpg/ecpglib/misc.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.35 2007/03/29 12:02:24 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.36 2007/08/14 10:01:52 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -213,20 +213,14 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
if (con->committed && !con->autocommit && strncmp(transaction, "begin", 5) != 0 && strncmp(transaction, "start", 5) != 0)
{
res = PQexec(con->connection, "begin transaction");
- if (res == NULL || PQresultStatus(res) != PGRES_COMMAND_OK)
- {
- ECPGraise(lineno, ECPG_TRANS, ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN, NULL);
+ if (!ECPGcheck_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
return FALSE;
- }
PQclear(res);
}
res = PQexec(con->connection, transaction);
- if (res == NULL || PQresultStatus(res) != PGRES_COMMAND_OK)
- {
- ECPGraise(lineno, ECPG_TRANS, ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN, NULL);
+ if (!ECPGcheck_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
return FALSE;
- }
PQclear(res);
}