diff options
Diffstat (limited to 'storage/innobase/include/mtr0mtr.ic')
-rw-r--r-- | storage/innobase/include/mtr0mtr.ic | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic index 0fe56f960b7..aee390cf8b2 100644 --- a/storage/innobase/include/mtr0mtr.ic +++ b/storage/innobase/include/mtr0mtr.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -178,19 +178,6 @@ mtr_t::release_block_at_savepoint( } /** -Gets the logging mode of a mini-transaction. -@return logging mode: MTR_LOG_NONE, ... */ - -mtr_log_t -mtr_t::get_log_mode() const -{ - ut_ad(m_log_mode >= MTR_LOG_ALL); - ut_ad(m_log_mode <= MTR_LOG_SHORT_INSERTS); - - return m_log_mode; -} - -/** Changes the logging mode of a mini-transaction. @return old mode */ @@ -198,9 +185,9 @@ mtr_log_t mtr_t::set_log_mode(mtr_log_t mode) { ut_ad(mode >= MTR_LOG_ALL); - ut_ad(mode <= MTR_LOG_SHORT_INSERTS); + ut_ad(mode <= MTR_LOG_NO_REDO); - const mtr_log_t old_mode = m_log_mode; + const mtr_log_t old_mode = get_log_mode(); switch (old_mode) { case MTR_LOG_NO_REDO: @@ -208,19 +195,17 @@ mtr_t::set_log_mode(mtr_log_t mode) ut_ad(mode == MTR_LOG_NO_REDO || mode == MTR_LOG_NONE); return(old_mode); case MTR_LOG_NONE: - if (mode == old_mode || mode == MTR_LOG_SHORT_INSERTS) { + if (mode == old_mode) { /* Keep MTR_LOG_NONE. */ return(old_mode); } - /* fall through */ - case MTR_LOG_SHORT_INSERTS: ut_ad(mode == MTR_LOG_ALL); /* fall through */ case MTR_LOG_ALL: /* MTR_LOG_NO_REDO can only be set before generating any redo log records. */ - ut_ad(mode != MTR_LOG_NO_REDO || m_n_log_recs == 0); - m_log_mode = mode; + ut_ad(mode != MTR_LOG_NO_REDO || m_log.empty()); + m_log_mode = mode & 3; return(old_mode); } |