mysql: Don't release the connection if transactions are still using it
Fixes #2779.
This commit is contained in:
@@ -130,11 +130,15 @@ typedef struct {
|
|||||||
* Release a mysql connection
|
* Release a mysql connection
|
||||||
*/
|
*/
|
||||||
static void conn_release(private_mysql_database_t *this, conn_t *conn)
|
static void conn_release(private_mysql_database_t *this, conn_t *conn)
|
||||||
|
{
|
||||||
|
/* do not release the connection while transactions are using it */
|
||||||
|
if (!this->transaction->get(this->transaction))
|
||||||
{
|
{
|
||||||
this->mutex->lock(this->mutex);
|
this->mutex->lock(this->mutex);
|
||||||
conn->in_use = FALSE;
|
conn->in_use = FALSE;
|
||||||
this->mutex->unlock(this->mutex);
|
this->mutex->unlock(this->mutex);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy a transaction and release the connection
|
* Destroy a transaction and release the connection
|
||||||
|
|||||||
Reference in New Issue
Block a user