mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-24 09:53:43 +03:00
Unlock the connection after PQflush error
Apparently this has never happened... anyway the code path was wrong. Fixes #294.
This commit is contained in:
parent
8739484b61
commit
a70a541e0b
1
NEWS
1
NEWS
|
@ -4,6 +4,7 @@ Current release
|
|||
What's new in psycopg 2.6.1
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Correctly unlock the connection after error in flush (:ticket:`#294`).
|
||||
- Fixed ``MinTimeLoggingCursor.callproc()`` (:ticket:`#309`).
|
||||
|
||||
|
||||
|
|
|
@ -980,6 +980,10 @@ pq_execute(cursorObject *curs, const char *query, int async, int no_result, int
|
|||
}
|
||||
else {
|
||||
/* there was an error */
|
||||
pthread_mutex_unlock(&(curs->conn->lock));
|
||||
Py_BLOCK_THREADS;
|
||||
PyErr_SetString(OperationalError,
|
||||
PQerrorMessage(curs->conn->pgconn));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user