diff options
Diffstat (limited to 'storage/xtradb/handler/i_s.cc')
-rw-r--r-- | storage/xtradb/handler/i_s.cc | 65 |
1 files changed, 41 insertions, 24 deletions
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc index ccbf5c7dbe7..488c45c4aba 100644 --- a/storage/xtradb/handler/i_s.cc +++ b/storage/xtradb/handler/i_s.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 2007, 2013, Innobase Oy. All Rights Reserved. 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 @@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *****************************************************************************/ @@ -33,7 +33,7 @@ Created July 18, 2007 Vasil Dimov #include <ctype.h> /*toupper*/ #include <mysqld_error.h> -#include <sql_acl.h> // PROCESS_ACL +#include <sql_acl.h> #include <m_ctype.h> #include <hash.h> @@ -47,22 +47,17 @@ Created July 18, 2007 Vasil Dimov extern "C" { #include "btr0pcur.h" /* for file sys_tables related info. */ #include "btr0types.h" -#include "buf0buddy.h" /* for i_s_cmpmem */ -#include "buf0buf.h" /* for buf_pool and PAGE_ZIP_MIN_SIZE */ -#include "dict0load.h" /* for file sys_tables related info. */ +#include "buf0buddy.h" +#include "buf0buf.h" +#include "ibuf0ibuf.h" #include "dict0mem.h" #include "dict0types.h" -#include "ha_prototypes.h" /* for innobase_convert_name() */ -#include "srv0srv.h" /* for srv_max_changed_pages */ -#include "srv0start.h" /* for srv_was_started */ +#include "dict0boot.h" +#include "ha_prototypes.h" +#include "srv0start.h" #include "trx0i_s.h" -#include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */ -#include "trx0rseg.h" /* for trx_rseg_struct */ -#include "trx0undo.h" /* for trx_undo_struct */ -#include "trx0sys.h" /* for trx_sys */ -#include "dict0dict.h" /* for dict_sys */ -#include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */ -#include "btr0btr.h" /* for btr_page_get_index_id */ +#include "trx0rseg.h" +#include "trx0undo.h" #include "log0online.h" #include "btr0btr.h" #include "page0zip.h" @@ -79,8 +74,12 @@ struct buffer_page_desc_str_struct{ typedef struct buffer_page_desc_str_struct buf_page_desc_str_t; -/** Any states greater than FIL_PAGE_TYPE_LAST would be treated as unknown. */ -#define I_S_PAGE_TYPE_UNKNOWN (FIL_PAGE_TYPE_LAST + 1) +/** Change buffer B-tree page */ +#define I_S_PAGE_TYPE_IBUF (FIL_PAGE_TYPE_LAST + 1) + +/** Any states greater than I_S_PAGE_TYPE_IBUF would be treated as +unknown. */ +#define I_S_PAGE_TYPE_UNKNOWN (I_S_PAGE_TYPE_IBUF + 1) /** We also define I_S_PAGE_TYPE_INDEX as the Index Page's position in i_s_page_type[] array */ @@ -101,6 +100,7 @@ static buf_page_desc_str_t i_s_page_type[] = { {"BLOB", FIL_PAGE_TYPE_BLOB}, {"COMPRESSED_BLOB", FIL_PAGE_TYPE_ZBLOB}, {"COMPRESSED_BLOB2", FIL_PAGE_TYPE_ZBLOB2}, + {"IBUF_INDEX", I_S_PAGE_TYPE_IBUF}, {"UNKNOWN", I_S_PAGE_TYPE_UNKNOWN} }; @@ -2760,14 +2760,21 @@ i_s_innodb_set_page_type( if (page_type == FIL_PAGE_INDEX) { const page_t* page = (const page_t*) frame; + page_info->index_id = btr_page_get_index_id(page); + /* FIL_PAGE_INDEX is a bit special, its value is defined as 17855, so we cannot use FIL_PAGE_INDEX to index into i_s_page_type[] array, its array index in the i_s_page_type[] array is I_S_PAGE_TYPE_INDEX - (1) */ - page_info->page_type = I_S_PAGE_TYPE_INDEX; - - page_info->index_id = btr_page_get_index_id(page); + (1) for index pages or I_S_PAGE_TYPE_IBUF for + change buffer index pages */ + if (page_info->index_id + == static_cast<index_id_t>(DICT_IBUF_ID_MIN + + IBUF_SPACE_ID)) { + page_info->page_type = I_S_PAGE_TYPE_IBUF; + } else { + page_info->page_type = I_S_PAGE_TYPE_INDEX; + } page_info->data_size = (ulint)(page_header_get_field( page, PAGE_HEAP_TOP) - (page_is_comp(page) @@ -2776,7 +2783,7 @@ i_s_innodb_set_page_type( - page_header_get_field(page, PAGE_GARBAGE)); page_info->num_recs = page_get_n_recs(page); - } else if (page_type >= I_S_PAGE_TYPE_UNKNOWN) { + } else if (page_type > FIL_PAGE_TYPE_LAST) { /* Encountered an unknown page type */ page_info->page_type = I_S_PAGE_TYPE_UNKNOWN; } else { @@ -2848,6 +2855,16 @@ i_s_innodb_buffer_page_get_info( page_info->freed_page_clock = bpage->freed_page_clock; + switch (buf_page_get_io_fix(bpage)) { + case BUF_IO_NONE: + case BUF_IO_WRITE: + case BUF_IO_PIN: + break; + case BUF_IO_READ: + page_info->page_type = I_S_PAGE_TYPE_UNKNOWN; + return; + } + if (page_info->page_state == BUF_BLOCK_FILE_PAGE) { const buf_block_t*block; |