Commit 772aa0c5 authored by Jan Lindström's avatar Jan Lindström

MDEV-6160: InnoDB: Failing assertion: page_is_comp(next_page) == page_is_comp(page)

This is not yet a fix. This is change to print additional information at the point
when this assertion is going to happen. Print as much information about the pages
and index to find out why next page is not a compact format.
parent 53612e77
This diff is collapsed.
......@@ -425,9 +425,24 @@ btr_pcur_move_to_next_page(
btr_pcur_get_btr_cur(cursor)->index, mtr);
next_page = buf_block_get_frame(next_block);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(next_page) == page_is_comp(page));
ut_a(btr_page_get_prev(next_page, mtr)
== buf_block_get_page_no(btr_pcur_get_block(cursor)));
if (page_is_comp(next_page) != page_is_comp(page)) {
btr_pages_info(page, next_page, space,
zip_size, next_page_no, cursor->latch_mode,
btr_pcur_get_btr_cur(cursor)->index,
btr_page_get_next(page, mtr),
btr_page_get_prev(page, mtr),
buf_block_get_space(next_block),
buf_block_get_zip_size(next_block),
btr_page_get_next(next_page, mtr),
btr_page_get_prev(next_page, mtr),
mtr, __FILE__, __LINE__);
ut_a(page_is_comp(next_page) == page_is_comp(page));
ut_a(btr_page_get_prev(next_page, mtr)
== buf_block_get_page_no(btr_pcur_get_block(cursor)));
}
#endif /* UNIV_BTR_DEBUG */
next_block->check_index_page_at_flush = TRUE;
......
......@@ -457,6 +457,21 @@ fil_space_get_by_id(
return(space);
}
/*******************************************************************//**
Returns the table space name for a given id, NULL if not found. */
const char*
fil_space_get_name(
/*================*/
ulint id) /*!< in: space id */
{
fil_space_t* space;
mutex_enter(&fil_system->mutex);
space = fil_space_get_by_id(id);
mutex_exit(&fil_system->mutex);
return (space == NULL ? NULL : space->name);
}
/*******************************************************************//**
Returns the table space by a given name, NULL if not found. */
UNIV_INLINE
......
......@@ -825,6 +825,28 @@ extern ulint btr_cur_n_sea_old;
extern uint btr_cur_limit_optimistic_insert_debug;
#endif /* UNIV_DEBUG */
/*******************************************************************//**
Print information about old page and a new page on a B-tree when
we note that page types do not match.*/
void
btr_pages_info(
page_t* old_page, /*!< in: Page where we were */
page_t* new_page, /*!< in: Page where we travelsed */
ulint space_id, /*!< in: space id */
ulint zip_size, /*!< in: zip size */
ulint page_no, /*!< in: Page id where travelsed */
ulint latch_mode, /*!< in: Used latch mode */
dict_index_t* index, /*!< in: Used index */
ulint old_next_page_no, /*!< in: Next page number from old page */
ulint old_prev_page_no, /*!< in: Prev page number from old page */
ulint new_space_id, /*!< in: Space id of new page */
ulint new_zip_size, /*!< in: Zip size of new page */
ulint new_next_page_no, /*!< in: Next page number from new page */
ulint new_prev_page_no, /*!< in: Prev page number from new page */
mtr_t* mtr, /*!< in: mini transaction */
const char* file, /*!< in: file name where called */
ulint line); /*!< in: line number where called */
#ifndef UNIV_NONINL
#include "btr0cur.ic"
#endif
......
......@@ -752,6 +752,14 @@ fil_mtr_rename_log(
const char* tmp_name); /*!< in: temp table name used while
swapping */
typedef struct fil_space_struct fil_space_t;
/*******************************************************************//**
Returns the table space name for a given id, NULL if not found. */
const char*
fil_space_get_name(
/*================*/
ulint id); /*!< in: space id */
#endif
This diff is collapsed.
......@@ -440,9 +440,24 @@ btr_pcur_move_to_next_page(
});
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(next_page) == page_is_comp(page));
ut_a(btr_page_get_prev(next_page, mtr)
== buf_block_get_page_no(btr_pcur_get_block(cursor)));
if (page_is_comp(next_page) != page_is_comp(page)) {
btr_pages_info(page, next_page, space,
zip_size, next_page_no, cursor->latch_mode,
btr_pcur_get_btr_cur(cursor)->index,
btr_page_get_next(page, mtr),
btr_page_get_prev(page, mtr),
buf_block_get_space(next_block),
buf_block_get_zip_size(next_block),
btr_page_get_next(next_page, mtr),
btr_page_get_prev(next_page, mtr),
mtr, __FILE__, __LINE__);
ut_a(page_is_comp(next_page) == page_is_comp(page));
ut_a(btr_page_get_prev(next_page, mtr)
== buf_block_get_page_no(btr_pcur_get_block(cursor)));
}
#endif /* UNIV_BTR_DEBUG */
next_block->check_index_page_at_flush = TRUE;
......
......@@ -467,6 +467,21 @@ fil_space_get_by_id(
return(space);
}
/*******************************************************************//**
Returns the table space name for a given id, NULL if not found. */
const char*
fil_space_get_name(
/*================*/
ulint id) /*!< in: space id */
{
fil_space_t* space;
mutex_enter(&fil_system->mutex);
space = fil_space_get_by_id(id);
mutex_exit(&fil_system->mutex);
return (space == NULL ? NULL : space->name);
}
/*******************************************************************//**
Returns the table space by a given name, NULL if not found. */
UNIV_INLINE
......
......@@ -826,6 +826,28 @@ extern ulint btr_cur_n_sea_old;
extern uint btr_cur_limit_optimistic_insert_debug;
#endif /* UNIV_DEBUG */
/*******************************************************************//**
Print information about old page and a new page on a B-tree when
we note that page types do not match.*/
void
btr_pages_info(
page_t* old_page, /*!< in: Page where we were */
page_t* new_page, /*!< in: Page where we travelsed */
ulint space_id, /*!< in: space id */
ulint zip_size, /*!< in: zip size */
ulint page_no, /*!< in: Page id where travelsed */
ulint latch_mode, /*!< in: Used latch mode */
dict_index_t* index, /*!< in: Used index */
ulint old_next_page_no, /*!< in: Next page number from old page */
ulint old_prev_page_no, /*!< in: Prev page number from old page */
ulint new_space_id, /*!< in: Space id of new page */
ulint new_zip_size, /*!< in: Zip size of new page */
ulint new_next_page_no, /*!< in: Next page number from new page */
ulint new_prev_page_no, /*!< in: Prev page number from new page */
mtr_t* mtr, /*!< in: mini transaction */
const char* file, /*!< in: file name where called */
ulint line); /*!< in: line number where called */
#ifndef UNIV_NONINL
#include "btr0cur.ic"
#endif
......
......@@ -794,6 +794,14 @@ fil_mtr_rename_log(
const char* tmp_name); /*!< in: temp table name used while
swapping */
typedef struct fil_space_struct fil_space_t;
/*******************************************************************//**
Returns the table space name for a given id, NULL if not found. */
const char*
fil_space_get_name(
/*================*/
ulint id); /*!< in: space id */
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment