1/***************************************************************************** 2 3Copyright (c) 1996, 2009, Oracle and/or its affiliates. All Rights Reserved. 4 5This program is free software; you can redistribute it and/or modify 6it under the terms of the GNU General Public License, version 2.0, 7as published by the Free Software Foundation. 8 9This program is also distributed with certain software (including 10but not limited to OpenSSL) that is licensed under separate terms, 11as designated in a particular file or component or in included license 12documentation. The authors of MySQL hereby grant you an additional 13permission to link the program and your derivative works with the 14separately licensed software that they have included with MySQL. 15 16This program is distributed in the hope that it will be useful, 17but WITHOUT ANY WARRANTY; without even the implied warranty of 18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19GNU General Public License, version 2.0, for more details. 20 21You should have received a copy of the GNU General Public License along with 22this program; if not, write to the Free Software Foundation, Inc., 2351 Franklin Street, Suite 500, Boston, MA 02110-1335 USA 24 25*****************************************************************************/ 26 27/**************************************************//** 28@file include/trx0purge.ic 29Purge old versions 30 31Created 3/26/1996 Heikki Tuuri 32*******************************************************/ 33 34#include "trx0undo.h" 35 36/********************************************************************//** 37Calculates the file address of an undo log header when we have the file 38address of its history list node. 39@return file address of the log */ 40UNIV_INLINE 41fil_addr_t 42trx_purge_get_log_from_hist( 43/*========================*/ 44 fil_addr_t node_addr) /*!< in: file address of the history 45 list node of the log */ 46{ 47 node_addr.boffset -= TRX_UNDO_HISTORY_NODE; 48 49 return(node_addr); 50} 51 52#ifdef UNIV_DEBUG 53/********************************************************************//** 54address of its history list node. 55@return TRUE if purge_sys_t::limit <= purge_sys_t::iter*/ 56UNIV_INLINE 57ibool 58trx_purge_check_limit(void) 59/*=======================*/ 60{ 61 ut_ad(purge_sys->limit.trx_no <= purge_sys->iter.trx_no); 62 63 if (purge_sys->limit.trx_no == purge_sys->iter.trx_no) { 64 ut_ad(purge_sys->limit.undo_no <= purge_sys->iter.undo_no); 65 } 66 67 return(TRUE); 68} 69#endif /* UNIV_DEBUG */ 70 71