From 83d0e72b34154dd24bb5b66f1732fb7753665d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 1 Jun 2020 10:23:11 +0300 Subject: [PATCH] Cleanup: Remove thr_is_recv(), trx_is_recv() Compare to trx_roll_crash_recv_trx directly where needed. --- storage/innobase/btr/btr0cur.cc | 2 +- storage/innobase/include/que0que.h | 12 +----------- storage/innobase/include/que0que.ic | 15 +-------------- storage/innobase/include/trx0roll.h | 11 +---------- storage/innobase/row/row0umod.cc | 2 +- storage/innobase/row/row0upd.cc | 3 ++- storage/innobase/trx/trx0roll.cc | 13 ------------- 7 files changed, 7 insertions(+), 51 deletions(-) diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 37ba133cb0f5e..f7cef687dc8c1 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -3998,7 +3998,7 @@ btr_cur_optimistic_update( ULINT_UNDEFINED, heap); #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG ut_a(!rec_offs_any_null_extern(rec, *offsets) - || trx_is_recv(thr_get_trx(thr))); + || thr_get_trx(thr) == trx_roll_crash_recv_trx); #endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */ if (!row_upd_changes_field_size_or_external(index, *offsets, update)) { diff --git a/storage/innobase/include/que0que.h b/storage/innobase/include/que0que.h index 8489551e64de7..f6609993601e6 100644 --- a/storage/innobase/include/que0que.h +++ b/storage/innobase/include/que0que.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, 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 @@ -169,16 +169,6 @@ trx_t* thr_get_trx( /*========*/ que_thr_t* thr); /*!< in: query thread */ -/*******************************************************************//** -Determines if this thread is rolling back an incomplete transaction -in crash recovery. -@return TRUE if thr is rolling back an incomplete transaction in crash -recovery */ -UNIV_INLINE -ibool -thr_is_recv( -/*========*/ - const que_thr_t* thr); /*!< in: query thread */ /***********************************************************************//** Gets the type of a graph node. */ UNIV_INLINE diff --git a/storage/innobase/include/que0que.ic b/storage/innobase/include/que0que.ic index 5b775820df7b3..1c3ac242bf25b 100644 --- a/storage/innobase/include/que0que.ic +++ b/storage/innobase/include/que0que.ic @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 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 @@ -36,20 +37,6 @@ thr_get_trx( return(thr->graph->trx); } -/*******************************************************************//** -Determines if this thread is rolling back an incomplete transaction -in crash recovery. -@return TRUE if thr is rolling back an incomplete transaction in crash -recovery */ -UNIV_INLINE -ibool -thr_is_recv( -/*========*/ - const que_thr_t* thr) /*!< in: query thread */ -{ - return(trx_is_recv(thr->graph->trx)); -} - /***********************************************************************//** Gets the first thr in a fork. */ UNIV_INLINE diff --git a/storage/innobase/include/trx0roll.h b/storage/innobase/include/trx0roll.h index cae548d442b09..0fd6973e551ac 100644 --- a/storage/innobase/include/trx0roll.h +++ b/storage/innobase/include/trx0roll.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2019, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -34,15 +34,6 @@ Created 3/26/1996 Heikki Tuuri extern bool trx_rollback_or_clean_is_active; extern const trx_t* trx_roll_crash_recv_trx; -/*******************************************************************//** -Determines if this transaction is rolling back an incomplete transaction -in crash recovery. -@return TRUE if trx is an incomplete transaction that is being rolled -back in crash recovery */ -ibool -trx_is_recv( -/*========*/ - const trx_t* trx); /*!< in: transaction */ /*******************************************************************//** Returns a transaction savepoint taken at this point in time. @return savepoint */ diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index ac4500f5c3e11..80d90f4037938 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -884,7 +884,7 @@ row_undo_mod_upd_del_sec( does not exist. However, this situation may only occur during the rollback of incomplete transactions. */ - ut_a(thr_is_recv(thr)); + ut_a(thr_get_trx(thr) == trx_roll_crash_recv_trx); } else { err = row_undo_mod_del_mark_or_remove_sec( node, thr, index, entry); diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index a316041ed0e1f..a1e840a9cb9cd 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -1882,7 +1882,8 @@ row_upd_changes_ord_field_binary_func( when the server had crashed before storing the field. */ ut_ad(thr->graph->trx->is_recovered); - ut_ad(trx_is_recv(thr->graph->trx)); + ut_ad(thr->graph->trx + == trx_roll_crash_recv_trx); return(TRUE); } diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index 0e03346bb9dbc..9c63c68f84f40 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -551,19 +551,6 @@ trx_release_savepoint_for_mysql( return(savep != NULL ? DB_SUCCESS : DB_NO_SAVEPOINT); } -/*******************************************************************//** -Determines if this transaction is rolling back an incomplete transaction -in crash recovery. -@return TRUE if trx is an incomplete transaction that is being rolled -back in crash recovery */ -ibool -trx_is_recv( -/*========*/ - const trx_t* trx) /*!< in: transaction */ -{ - return(trx == trx_roll_crash_recv_trx); -} - /*******************************************************************//** Returns a transaction savepoint taken at this point in time. @return savepoint */