mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-12-01 05:03:44 +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
|
What's new in psycopg 2.6.1
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
- Correctly unlock the connection after error in flush (:ticket:`#294`).
|
||||||
- Fixed ``MinTimeLoggingCursor.callproc()`` (:ticket:`#309`).
|
- Fixed ``MinTimeLoggingCursor.callproc()`` (:ticket:`#309`).
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -980,6 +980,10 @@ pq_execute(cursorObject *curs, const char *query, int async, int no_result, int
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* there was an error */
|
/* there was an error */
|
||||||
|
pthread_mutex_unlock(&(curs->conn->lock));
|
||||||
|
Py_BLOCK_THREADS;
|
||||||
|
PyErr_SetString(OperationalError,
|
||||||
|
PQerrorMessage(curs->conn->pgconn));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user