Skip to content

Commit

Permalink
Cleanup: Remove thr_is_recv(), trx_is_recv()
Browse files Browse the repository at this point in the history
Compare to trx_roll_crash_recv_trx directly where needed.
  • Loading branch information
dr-m committed Jun 1, 2020
1 parent c50b7be commit 83d0e72
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 51 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/btr/btr0cur.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
12 changes: 1 addition & 11 deletions storage/innobase/include/que0que.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions storage/innobase/include/que0que.ic
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 1 addition & 10 deletions storage/innobase/include/trx0roll.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/row/row0umod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion storage/innobase/row/row0upd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
13 changes: 0 additions & 13 deletions storage/innobase/trx/trx0roll.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 83d0e72

Please sign in to comment.