From aec4734f615cb13c3687b205782020259ea5a743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 8 Mar 2018 12:25:01 +0200 Subject: MDEV-13935: INSERT INTO stuck at state "Unlocking tables" There were some differences on MariaDB compared with MySQL. Fix these differences. --- storage/innobase/include/trx0trx.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 674eee572ed..412a35a14f4 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -1489,8 +1489,12 @@ private: } /* Avoid excessive mutex acquire/release */ - if (trx->in_depth++) { - /* The transaction is already inside InnoDB. */ + ++trx->in_depth; + + /* If trx->in_depth is greater than 1 then + transaction is already in InnoDB. */ + if (trx->in_depth > 1) { + return; } @@ -1518,7 +1522,10 @@ private: ut_ad(trx->in_depth > 0); - if (--trx->in_depth) { + --trx->in_depth; + + if (trx->in_depth > 0) { + return; } -- cgit v1.2.1