Commit abcd09c9 authored by Marko Mäkelä's avatar Marko Mäkelä

mtr_t::start(): Remove unused parameters

The parameters bool sync=true, bool read_only=false of mtr_t::start()
were added in
https://github.com/mysql/mysql-server/commit/eca5b0fc17a5bd6d4833d35a0d08c8549dd3b5ec
(MySQL 5.7.3).

The parameter read_only was never used anywhere.
The parameter sync was only copied around, and would be returned
by the unused function mtr_t::is_async().

We do not need this dead code in MariaDB.
parent d355be88
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc. Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 2017, MariaDB Corporation Copyright (c) 2013, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -37,12 +37,6 @@ Created 11/26/1995 Heikki Tuuri ...@@ -37,12 +37,6 @@ Created 11/26/1995 Heikki Tuuri
/** Start a mini-transaction. */ /** Start a mini-transaction. */
#define mtr_start(m) (m)->start() #define mtr_start(m) (m)->start()
/** Start a synchronous mini-transaction */
#define mtr_start_sync(m) (m)->start(true)
/** Start an asynchronous read-only mini-transaction */
#define mtr_start_ro(m) (m)->start(true, true)
/** Commit a mini-transaction. */ /** Commit a mini-transaction. */
#define mtr_commit(m) (m)->commit() #define mtr_commit(m) (m)->commit()
...@@ -223,22 +217,8 @@ struct mtr_t { ...@@ -223,22 +217,8 @@ struct mtr_t {
@param[in] n_reserved number of reserved extents */ @param[in] n_reserved number of reserved extents */
void release_free_extents(ulint n_reserved); void release_free_extents(ulint n_reserved);
/** Start a mini-transaction. /** Start a mini-transaction. */
@param sync true if it is a synchronous mini-transaction void start();
@param read_only true if read only mini-transaction */
void start(bool sync = true, bool read_only = false);
/** @return whether this is an asynchronous mini-transaction. */
bool is_async() const
{
return(!m_sync);
}
/** Request a future commit to be synchronous. */
void set_sync()
{
m_sync = true;
}
/** Commit the mini-transaction. */ /** Commit the mini-transaction. */
void commit(); void commit();
...@@ -590,9 +570,6 @@ struct mtr_t { ...@@ -590,9 +570,6 @@ struct mtr_t {
/** LSN at commit time */ /** LSN at commit time */
volatile lsn_t m_commit_lsn; volatile lsn_t m_commit_lsn;
/** true if it is synchronous mini-transaction */
bool m_sync;
}; };
#include "mtr0mtr.ic" #include "mtr0mtr.ic"
......
...@@ -183,8 +183,7 @@ trx_undo_rec_get_partial_row( ...@@ -183,8 +183,7 @@ trx_undo_rec_get_partial_row(
@param[in,out] trx transaction @param[in,out] trx transaction
@param[in] table table that is being renamed @param[in] table table that is being renamed
@return DB_SUCCESS or error code */ @return DB_SUCCESS or error code */
dberr_t dberr_t trx_undo_report_rename(trx_t* trx, const dict_table_t* table)
trx_undo_report_rename(trx_t* trx, const dict_table_t* table)
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//** /***********************************************************************//**
Writes information to an undo log about an insert, update, or a delete marking Writes information to an undo log about an insert, update, or a delete marking
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -383,18 +383,8 @@ class mtr_t::Command { ...@@ -383,18 +383,8 @@ class mtr_t::Command {
/** Constructor. /** Constructor.
Takes ownership of the mtr->m_impl, is responsible for deleting it. Takes ownership of the mtr->m_impl, is responsible for deleting it.
@param[in,out] mtr mini-transaction */ @param[in,out] mtr mini-transaction */
explicit Command(mtr_t* mtr) explicit Command(mtr_t* mtr) : m_impl(&mtr->m_impl), m_locks_released()
: {}
m_locks_released()
{
init(mtr);
}
void init(mtr_t* mtr)
{
m_impl = &mtr->m_impl;
m_sync = mtr->m_sync;
}
/** Destructor */ /** Destructor */
~Command() ~Command()
...@@ -427,9 +417,6 @@ class mtr_t::Command { ...@@ -427,9 +417,6 @@ class mtr_t::Command {
@return number of bytes to write in finish_write() */ @return number of bytes to write in finish_write() */
ulint prepare_write(); ulint prepare_write();
/** true if it is a sync mini-transaction. */
bool m_sync;
/** The mini-transaction state. */ /** The mini-transaction state. */
mtr_t::Impl* m_impl; mtr_t::Impl* m_impl;
...@@ -488,18 +475,13 @@ mtr_write_log( ...@@ -488,18 +475,13 @@ mtr_write_log(
log_close(); log_close();
} }
/** Start a mini-transaction. /** Start a mini-transaction. */
@param sync true if it is a synchronous mini-transaction void mtr_t::start()
@param read_only true if read only mini-transaction */
void
mtr_t::start(bool sync, bool read_only)
{ {
UNIV_MEM_INVALID(this, sizeof(*this)); UNIV_MEM_INVALID(this, sizeof(*this));
UNIV_MEM_INVALID(&m_impl, sizeof(m_impl)); UNIV_MEM_INVALID(&m_impl, sizeof(m_impl));
m_sync = sync;
m_commit_lsn = 0; m_commit_lsn = 0;
new(&m_impl.m_log) mtr_buf_t(); new(&m_impl.m_log) mtr_buf_t();
......
...@@ -1932,8 +1932,7 @@ trx_undo_page_report_rename(trx_t* trx, const dict_table_t* table, ...@@ -1932,8 +1932,7 @@ trx_undo_page_report_rename(trx_t* trx, const dict_table_t* table,
@param[in,out] trx transaction @param[in,out] trx transaction
@param[in] table table that is being renamed @param[in] table table that is being renamed
@return DB_SUCCESS or error code */ @return DB_SUCCESS or error code */
dberr_t dberr_t trx_undo_report_rename(trx_t* trx, const dict_table_t* table)
trx_undo_report_rename(trx_t* trx, const dict_table_t* table)
{ {
ut_ad(!trx->read_only); ut_ad(!trx->read_only);
ut_ad(trx->id); ut_ad(trx->id);
...@@ -1949,7 +1948,7 @@ trx_undo_report_rename(trx_t* trx, const dict_table_t* table) ...@@ -1949,7 +1948,7 @@ trx_undo_report_rename(trx_t* trx, const dict_table_t* table)
ut_ad((err == DB_SUCCESS) == (*pundo != NULL)); ut_ad((err == DB_SUCCESS) == (*pundo != NULL));
if (trx_undo_t* undo = *pundo) { if (trx_undo_t* undo = *pundo) {
mtr_t mtr; mtr_t mtr;
mtr.start(trx); mtr.start();
buf_block_t* block = buf_page_get_gen( buf_block_t* block = buf_page_get_gen(
page_id_t(undo->space, undo->last_page_no), page_id_t(undo->space, undo->last_page_no),
...@@ -1978,7 +1977,7 @@ trx_undo_report_rename(trx_t* trx, const dict_table_t* table) ...@@ -1978,7 +1977,7 @@ trx_undo_report_rename(trx_t* trx, const dict_table_t* table)
break; break;
} else { } else {
mtr.commit(); mtr.commit();
mtr.start(trx); mtr.start();
block = trx_undo_add_page(trx, undo, &mtr); block = trx_undo_add_page(trx, undo, &mtr);
if (!block) { if (!block) {
err = DB_OUT_OF_FILE_SPACE; err = DB_OUT_OF_FILE_SPACE;
......
...@@ -1838,9 +1838,6 @@ trx_commit_low( ...@@ -1838,9 +1838,6 @@ trx_commit_low(
bool serialised; bool serialised;
if (mtr != NULL) { if (mtr != NULL) {
mtr->set_sync();
serialised = trx_write_serialisation_history(trx, mtr); serialised = trx_write_serialisation_history(trx, mtr);
/* The following call commits the mini-transaction, making the /* The following call commits the mini-transaction, making the
...@@ -1905,7 +1902,7 @@ trx_commit( ...@@ -1905,7 +1902,7 @@ trx_commit(
if (trx->has_logged()) { if (trx->has_logged()) {
mtr = &local_mtr; mtr = &local_mtr;
mtr_start_sync(mtr); mtr->start();
} else { } else {
mtr = NULL; mtr = NULL;
...@@ -2566,7 +2563,7 @@ trx_prepare_low(trx_t* trx) ...@@ -2566,7 +2563,7 @@ trx_prepare_low(trx_t* trx)
trx_rseg_t* rseg = trx->rsegs.m_redo.rseg; trx_rseg_t* rseg = trx->rsegs.m_redo.rseg;
mtr.start(true); mtr.start();
/* Change the undo log segment states from TRX_UNDO_ACTIVE to /* Change the undo log segment states from TRX_UNDO_ACTIVE to
TRX_UNDO_PREPARED: these modifications to the file data TRX_UNDO_PREPARED: these modifications to the file data
......
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