summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-11-14 10:51:06 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-11-14 10:51:06 +0200
commitbc5cfe7769cbf849521465718ade9e9b9b5854c8 (patch)
treee810ba3efc8758f2ecd110698b0889667a44986c
parentd4edb0510ec1189f65850bb47977e94ed98b1f71 (diff)
parent3b573c0783eded1662760dd7ec56404ceb5f2975 (diff)
downloadmariadb-git-bc5cfe7769cbf849521465718ade9e9b9b5854c8.tar.gz
Merge 10.2 into 10.3
-rwxr-xr-x[-rw-r--r--]debian/mariadb-plugin-mroonga.prerm2
-rw-r--r--storage/innobase/mtr/mtr0mtr.cc197
2 files changed, 69 insertions, 130 deletions
diff --git a/debian/mariadb-plugin-mroonga.prerm b/debian/mariadb-plugin-mroonga.prerm
index b64ea064142..cdd26ebbc45 100644..100755
--- a/debian/mariadb-plugin-mroonga.prerm
+++ b/debian/mariadb-plugin-mroonga.prerm
@@ -2,7 +2,7 @@
set -e
-# Install Mroonga
+# Uninstall Mroonga
mysql --defaults-file=/etc/mysql/debian.cnf < /usr/share/mysql/mroonga/uninstall.sql || true
# Always exit with success instead of leaving dpkg in a broken state
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index 6a022da9e5b..06b0413447a 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -30,9 +30,7 @@ Created 11/26/1995 Heikki Tuuri
#include "buf0flu.h"
#include "page0types.h"
#include "mtr0log.h"
-#include "log0log.h"
#include "row0trunc.h"
-
#include "log0recv.h"
/** Iterate over a memo block in reverse. */
@@ -204,143 +202,84 @@ private:
/** Release latches and decrement the buffer fix count.
@param slot memo slot */
-static
-void
-memo_slot_release(mtr_memo_slot_t* slot)
-{
- switch (slot->type) {
- case MTR_MEMO_BUF_FIX:
- case MTR_MEMO_PAGE_S_FIX:
- case MTR_MEMO_PAGE_SX_FIX:
- case MTR_MEMO_PAGE_X_FIX: {
-
- buf_block_t* block;
-
- block = reinterpret_cast<buf_block_t*>(slot->object);
-
- buf_block_unfix(block);
- buf_page_release_latch(block, slot->type);
- break;
- }
-
- case MTR_MEMO_S_LOCK:
- rw_lock_s_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
- break;
-
- case MTR_MEMO_SX_LOCK:
- rw_lock_sx_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
- break;
-
- case MTR_MEMO_X_LOCK:
- rw_lock_x_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
- break;
-
-#ifdef UNIV_DEBUG
- default:
- ut_ad(slot->type == MTR_MEMO_MODIFY);
-#endif /* UNIV_DEBUG */
- }
-
- slot->object = NULL;
-}
-
-/** Unfix a page, do not release the latches on the page.
-@param slot memo slot */
-static
-void
-memo_block_unfix(mtr_memo_slot_t* slot)
+static void memo_slot_release(mtr_memo_slot_t *slot)
{
- switch (slot->type) {
- case MTR_MEMO_BUF_FIX:
- case MTR_MEMO_PAGE_S_FIX:
- case MTR_MEMO_PAGE_X_FIX:
- case MTR_MEMO_PAGE_SX_FIX: {
- buf_block_unfix(reinterpret_cast<buf_block_t*>(slot->object));
- break;
- }
-
- case MTR_MEMO_S_LOCK:
- case MTR_MEMO_X_LOCK:
- case MTR_MEMO_SX_LOCK:
- break;
-#ifdef UNIV_DEBUG
- default:
-#endif /* UNIV_DEBUG */
- break;
- }
-}
-/** Release latches represented by a slot.
-@param slot memo slot */
-static
-void
-memo_latch_release(mtr_memo_slot_t* slot)
-{
- switch (slot->type) {
- case MTR_MEMO_BUF_FIX:
- case MTR_MEMO_PAGE_S_FIX:
- case MTR_MEMO_PAGE_SX_FIX:
- case MTR_MEMO_PAGE_X_FIX: {
- buf_block_t* block;
-
- block = reinterpret_cast<buf_block_t*>(slot->object);
-
- memo_block_unfix(slot);
-
- buf_page_release_latch(block, slot->type);
-
- slot->object = NULL;
- break;
- }
-
- case MTR_MEMO_S_LOCK:
- rw_lock_s_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
- slot->object = NULL;
- break;
-
- case MTR_MEMO_X_LOCK:
- rw_lock_x_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
- slot->object = NULL;
- break;
-
- case MTR_MEMO_SX_LOCK:
- rw_lock_sx_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
- slot->object = NULL;
- break;
-
+ switch (slot->type) {
#ifdef UNIV_DEBUG
- default:
- ut_ad(slot->type == MTR_MEMO_MODIFY);
-
- slot->object = NULL;
+ default:
+ ut_ad(!"invalid type");
+ break;
+ case MTR_MEMO_MODIFY:
+ break;
#endif /* UNIV_DEBUG */
- }
+ case MTR_MEMO_S_LOCK:
+ rw_lock_s_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
+ break;
+ case MTR_MEMO_SX_LOCK:
+ rw_lock_sx_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
+ break;
+ case MTR_MEMO_X_LOCK:
+ rw_lock_x_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
+ break;
+ case MTR_MEMO_BUF_FIX:
+ case MTR_MEMO_PAGE_S_FIX:
+ case MTR_MEMO_PAGE_SX_FIX:
+ case MTR_MEMO_PAGE_X_FIX:
+ buf_block_t *block= reinterpret_cast<buf_block_t*>(slot->object);
+ buf_block_unfix(block);
+ buf_page_release_latch(block, slot->type);
+ break;
+ }
+ slot->object= NULL;
}
/** Release the latches acquired by the mini-transaction. */
struct ReleaseLatches {
-
- /** @return true always. */
- bool operator()(mtr_memo_slot_t* slot) const
- {
- if (slot->object != NULL) {
- memo_latch_release(slot);
- }
-
- return(true);
- }
+ /** @return true always. */
+ bool operator()(mtr_memo_slot_t *slot) const
+ {
+ if (!slot->object)
+ return true;
+ switch (slot->type) {
+#ifdef UNIV_DEBUG
+ default:
+ ut_ad(!"invalid type");
+ break;
+ case MTR_MEMO_MODIFY:
+ break;
+#endif /* UNIV_DEBUG */
+ case MTR_MEMO_S_LOCK:
+ rw_lock_s_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
+ break;
+ case MTR_MEMO_X_LOCK:
+ rw_lock_x_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
+ break;
+ case MTR_MEMO_SX_LOCK:
+ rw_lock_sx_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
+ break;
+ case MTR_MEMO_BUF_FIX:
+ case MTR_MEMO_PAGE_S_FIX:
+ case MTR_MEMO_PAGE_SX_FIX:
+ case MTR_MEMO_PAGE_X_FIX:
+ buf_block_t *block= reinterpret_cast<buf_block_t*>(slot->object);
+ buf_block_unfix(block);
+ buf_page_release_latch(block, slot->type);
+ break;
+ }
+ slot->object= NULL;
+ return true;
+ }
};
/** Release the latches and blocks acquired by the mini-transaction. */
struct ReleaseAll {
- /** @return true always. */
- bool operator()(mtr_memo_slot_t* slot) const
- {
- if (slot->object != NULL) {
- memo_slot_release(slot);
- }
-
- return(true);
- }
+ /** @return true always. */
+ bool operator()(mtr_memo_slot_t *slot) const
+ {
+ if (slot->object)
+ memo_slot_release(slot);
+ return true;
+ }
};
#ifdef UNIV_DEBUG
@@ -349,7 +288,7 @@ struct DebugCheck {
/** @return true always. */
bool operator()(const mtr_memo_slot_t* slot) const
{
- ut_a(slot->object == NULL);
+ ut_ad(!slot->object);
return(true);
}
};