diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-10-11 00:03:08 +0100 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-05 09:34:48 +0000 |
| commit | 17d70babb1cf589c23fc1c7f008ba4e10a48cf72 (patch) | |
| tree | 0983608363123bdd775358133cda4dad630a55e2 /psycopg/pqpath.c | |
| parent | 397eace051aaf633a8facbe92d04e2194c908e7d (diff) | |
| download | psycopg2-17d70babb1cf589c23fc1c7f008ba4e10a48cf72.tar.gz | |
Keep the GIL while converting the xid into the PostgreSQL transaction id.
Diffstat (limited to 'psycopg/pqpath.c')
| -rw-r--r-- | psycopg/pqpath.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 37d5279..3977f31 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -617,19 +617,17 @@ pq_reset(connectionObject *conn) * holding the global interpreter lock. */ int -pq_tpc_command_locked(connectionObject *conn, const char *cmd, XidObject *xid, - PGresult **pgres, char **error, - PyThreadState **tstate) +pq_tpc_command_locked(connectionObject *conn, const char *cmd, const char *tid, + PGresult **pgres, char **error, PyThreadState **tstate) { int rv = -1; - char *tid = NULL, *etid = NULL, *buf = NULL; + char *etid = NULL, *buf = NULL; Py_ssize_t buflen; Dprintf("_pq_tpc_command: pgconn = %p, command = %s", conn->pgconn, cmd); /* convert the xid into the postgres transaction_id and quote it. */ - if (!(tid = xid_get_tid(xid))) { goto exit; } if (!(etid = psycopg_escape_string((PyObject *)conn, tid, 0, NULL, NULL))) { goto exit; } @@ -647,7 +645,6 @@ pq_tpc_command_locked(connectionObject *conn, const char *cmd, XidObject *xid, exit: PyMem_Free(buf); PyMem_Free(etid); - PyMem_Free(tid); return rv; } |
