From f127fb98076c47929e8581d0d99eed886d4307ab Mon Sep 17 00:00:00 2001 From: Yasuhiro Horimoto Date: Tue, 12 Nov 2019 20:05:17 +0900 Subject: [PATCH 1/3] Fix a typo in mariadb-plugin-mroonga.prerm Closes #1407 --- debian/mariadb-plugin-mroonga.prerm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 debian/mariadb-plugin-mroonga.prerm diff --git a/debian/mariadb-plugin-mroonga.prerm b/debian/mariadb-plugin-mroonga.prerm old mode 100644 new mode 100755 index b64ea064142..cdd26ebbc45 --- 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 From abd45cdc38e72ce329365ffe0df4c6f8c319b407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 13 Nov 2019 09:26:10 +0200 Subject: [PATCH 2/3] MDEV-20934: Correct a debug assertion A search with PAGE_CUR_GE may land on the supremum record on a leaf page that is not the rightmost leaf page. This could occur when all keys on the current page are smaller than the search key, and the smallest key on the successor page is larger than the search key. ibuf_delete_recs(): Correct the debug assertion accordingly. --- storage/innobase/ibuf/ibuf0ibuf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 0377bdfe57f..ce6bfe02351 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -4349,7 +4349,7 @@ loop: &pcur, &mtr); if (!btr_pcur_is_on_user_rec(&pcur)) { - ut_ad(btr_pcur_is_after_last_in_tree(&pcur, &mtr)); + ut_ad(btr_pcur_is_after_last_on_page(&pcur)); goto func_exit; } From 3b573c0783eded1662760dd7ec56404ceb5f2975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 13 Nov 2019 09:51:28 +0200 Subject: [PATCH 3/3] Clean up mtr_t::commit() further memo_block_unfix(), memo_latch_release(): Merge to ReleaseLatches. memo_slot_release(), ReleaseAll: Clean up the formatting. --- storage/innobase/mtr/mtr0mtr.cc | 197 +++++++++++--------------------- 1 file changed, 68 insertions(+), 129 deletions(-) diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 533b10b861e..b75a9c4cf02 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) +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(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(slot->object)); - break; - - case MTR_MEMO_SX_LOCK: - rw_lock_sx_unlock(reinterpret_cast(slot->object)); - break; - - case MTR_MEMO_X_LOCK: - rw_lock_x_unlock(reinterpret_cast(slot->object)); - break; - + switch (slot->type) { #ifdef UNIV_DEBUG - default: - ut_ad(slot->type == MTR_MEMO_MODIFY); + default: + ut_ad(!"invalid type"); + break; + case MTR_MEMO_MODIFY: + break; #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) -{ - 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(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(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(slot->object)); - slot->object = NULL; - break; - - case MTR_MEMO_X_LOCK: - rw_lock_x_unlock(reinterpret_cast(slot->object)); - slot->object = NULL; - break; - - case MTR_MEMO_SX_LOCK: - rw_lock_sx_unlock(reinterpret_cast(slot->object)); - slot->object = NULL; - break; - -#ifdef UNIV_DEBUG - default: - ut_ad(slot->type == MTR_MEMO_MODIFY); - - slot->object = NULL; -#endif /* UNIV_DEBUG */ - } + case MTR_MEMO_S_LOCK: + rw_lock_s_unlock(reinterpret_cast(slot->object)); + break; + case MTR_MEMO_SX_LOCK: + rw_lock_sx_unlock(reinterpret_cast(slot->object)); + break; + case MTR_MEMO_X_LOCK: + rw_lock_x_unlock(reinterpret_cast(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(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(slot->object)); + break; + case MTR_MEMO_X_LOCK: + rw_lock_x_unlock(reinterpret_cast(slot->object)); + break; + case MTR_MEMO_SX_LOCK: + rw_lock_sx_unlock(reinterpret_cast(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(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); } };