mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Added patch by Bernd Helmle <bernd.helmle@credativ.de> that adds a low level
function that returns the current transaction status.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.51 2009/09/03 09:09:01 meskes Exp $ */
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.52 2009/09/18 13:13:32 meskes Exp $ */
|
||||
|
||||
#define POSTGRES_ECPG_INTERNAL
|
||||
#include "postgres_fe.h"
|
||||
@ -170,6 +170,21 @@ ECPGstatus(int lineno, const char *connection_name)
|
||||
return (true);
|
||||
}
|
||||
|
||||
PGTransactionStatusType
|
||||
ECPGtransactionStatus(const char *connection_name)
|
||||
{
|
||||
const struct connection *con;
|
||||
|
||||
con = ecpg_get_connection(connection_name);
|
||||
if (con == NULL) {
|
||||
/* transaction status is unknown */
|
||||
return PQTRANS_UNKNOWN;
|
||||
}
|
||||
|
||||
return PQtransactionStatus(con->connection);
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
ECPGtrans(int lineno, const char *connection_name, const char *transaction)
|
||||
{
|
||||
|
Reference in New Issue
Block a user