mysql: Don't release the connection if transactions are still using it

Fixes #2779.
This commit is contained in:
Tobias Brunner 2018-10-03 09:34:02 +02:00
parent 6c641377c3
commit a61b1a6ee4
1 changed files with 7 additions and 3 deletions

View File

@ -131,9 +131,13 @@ typedef struct {
*/ */
static void conn_release(private_mysql_database_t *this, conn_t *conn) static void conn_release(private_mysql_database_t *this, conn_t *conn)
{ {
this->mutex->lock(this->mutex); /* do not release the connection while transactions are using it */
conn->in_use = FALSE; if (!this->transaction->get(this->transaction))
this->mutex->unlock(this->mutex); {
this->mutex->lock(this->mutex);
conn->in_use = FALSE;
this->mutex->unlock(this->mutex);
}
} }
/** /**