Commit f817b822 authored by marko's avatar marko

trx_commit_for_mysql(): Avoid acquiring and releasing kernel_mutex when

trx->sess or trx_dummy_sess is non-NULL.
parent 3366420b
......@@ -1570,19 +1570,21 @@ trx_commit_for_mysql(
the transaction object does not have an InnoDB session object, and we
set the dummy session that we use for all MySQL transactions. */
mutex_enter(&kernel_mutex);
if (trx->sess == NULL) {
/* Open a dummy session */
if (!trx_dummy_sess) {
trx_dummy_sess = sess_open();
mutex_enter(&kernel_mutex);
if (!trx_dummy_sess) {
trx_dummy_sess = sess_open();
}
mutex_exit(&kernel_mutex);
}
trx->sess = trx_dummy_sess;
}
mutex_exit(&kernel_mutex);
trx_start_if_not_started(trx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment