| 1 |
/***************************************************************************** |
| 2 |
|
| 3 |
Copyright (c) 1996, 2026, Oracle and/or its affiliates. |
| 4 |
|
| 5 |
This program is free software; you can redistribute it and/or modify it under |
| 6 |
the terms of the GNU General Public License, version 2.0, as published by the |
| 7 |
Free Software Foundation. |
| 8 |
|
| 9 |
This program is designed to work with certain software (including |
| 10 |
but not limited to OpenSSL) that is licensed under separate terms, |
| 11 |
as designated in a particular file or component or in included license |
| 12 |
documentation. The authors of MySQL hereby grant you an additional |
| 13 |
permission to link the program and your derivative works with the |
| 14 |
separately licensed software that they have either included with |
| 15 |
the program or referenced in the documentation. |
| 16 |
|
| 17 |
This program is distributed in the hope that it will be useful, but WITHOUT |
| 18 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 19 |
FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, |
| 20 |
for more details. |
| 21 |
|
| 22 |
You should have received a copy of the GNU General Public License along with |
| 23 |
this program; if not, write to the Free Software Foundation, Inc., |
| 24 |
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 |
|
| 26 |
*****************************************************************************/ |
| 27 |
|
| 28 |
/** @file include/trx0purge.ic |
| 29 |
Purge old versions |
| 30 |
|
| 31 |
Created 3/26/1996 Heikki Tuuri |
| 32 |
*******************************************************/ |
| 33 |
|
| 34 |
#include "trx0undo.h" |
| 35 |
|
| 36 |
/** Calculates the file address of an undo log header when we have the file |
| 37 |
address of its history list node. |
| 38 |
@return file address of the log */ |
| 39 |
static inline fil_addr_t trx_purge_get_log_from_hist( |
| 40 |
fil_addr_t node_addr) /*!< in: file address of the history |
| 41 |
list node of the log */ |
| 42 |
{ |
| 43 |
node_addr.boffset -= TRX_UNDO_HISTORY_NODE; |
| 44 |
|
| 45 |
return (node_addr); |
| 46 |
} |
| 47 |
|
| 48 |
/** address of its history list node. |
| 49 |
@return true if purge_sys_t::limit <= purge_sys_t::iter */ |
| 50 |
static inline bool trx_purge_check_limit(void) { |
| 51 |
/* limit is used to track till what point purge element has been |
| 52 |
processed and so limit <= iter. |
| 53 |
undo_no ordering is enforced only within the same rollback segment. |
| 54 |
If a transaction uses multiple rollback segments then we need to |
| 55 |
consider the rollback segment space id too. */ |
| 56 |
return (purge_sys->iter.trx_no > purge_sys->limit.trx_no || |
| 57 |
(purge_sys->iter.trx_no == purge_sys->limit.trx_no && |
| 58 |
((purge_sys->iter.undo_no >= purge_sys->limit.undo_no) || |
| 59 |
(purge_sys->iter.undo_rseg_space != |
| 60 |
purge_sys->limit.undo_rseg_space)))); |
| 61 |
} |