List:Commits« Previous MessageNext Message »
From:marko.makela Date:May 14 2012 10:06am
Subject:bzr push into mysql-trunk branch (marko.makela:3829 to 3830) Bug#14058373
View as plain text  
 3830 Marko Mäkelä	2012-05-14
      Bug#14058373 ADD DEBUG ASSERTIONS FOR PAGE_INDEX_ID MISMATCH
      
      btr_cur_search_to_nth_level(), btr_cur_open_at_index_side_func(),
      btr_cur_open_at_rnd_pos_func(): Assert that the page type is FIL_PAGE_INDEX,
      a B-tree page.
      
      btr_cur_update_in_place(), btr_cur_optimistic_update(),
      page_cur_insert_rec_low(), page_cur_insert_rec_zip(),
      page_cur_delete_rec(), row_search_for_mysql(): Assert that the page
      type is FIL_PAGE_INDEX (a B-tree page) and that the PAGE_INDEX_ID
      matches the index->id.
      
      rb:1071 approved by Jimmy Yang

    modified:
      storage/innobase/btr/btr0cur.cc
      storage/innobase/page/page0cur.cc
      storage/innobase/row/row0sel.cc
 3829 Jorgen Loland	2012-05-14
      Bug#11754168 list bug-id from new bug system instead of old bug
      system in default.experimental

    modified:
      mysql-test/collections/default.experimental
=== modified file 'storage/innobase/btr/btr0cur.cc'
--- a/storage/innobase/btr/btr0cur.cc	revid:jorgen.loland@strippedm-20120514093058-4vd4gc1iosh2n6ba
+++ b/storage/innobase/btr/btr0cur.cc	revid:marko.makela@stripped59-hhlayhmg9a21gvef
@@ -713,6 +713,7 @@ retry_page_get:
 			? SYNC_IBUF_TREE_NODE : SYNC_TREE_NODE);
 	}
 
+	ut_ad(fil_page_get_type(page) == FIL_PAGE_INDEX);
 	ut_ad(index->id == btr_page_get_index_id(page));
 
 	if (UNIV_UNLIKELY(height == ULINT_UNDEFINED)) {
@@ -911,6 +912,7 @@ btr_cur_open_at_index_side_func(
 					 RW_NO_LATCH, NULL, BUF_GET,
 					 file, line, mtr);
 		page = buf_block_get_frame(block);
+		ut_ad(fil_page_get_type(page) == FIL_PAGE_INDEX);
 		ut_ad(index->id == btr_page_get_index_id(page));
 
 		block->check_index_page_at_flush = TRUE;
@@ -1040,6 +1042,7 @@ btr_cur_open_at_rnd_pos_func(
 					 RW_NO_LATCH, NULL, BUF_GET,
 					 file, line, mtr);
 		page = buf_block_get_frame(block);
+		ut_ad(fil_page_get_type(page) == FIL_PAGE_INDEX);
 		ut_ad(index->id == btr_page_get_index_id(page));
 
 		if (height == ULINT_UNDEFINED) {
@@ -1915,6 +1918,8 @@ btr_cur_update_in_place(
 	ut_ad(!thr || thr_get_trx(thr)->id == trx_id);
 	ut_ad(thr || flags == (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG
 			       | BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG));
+	ut_ad(fil_page_get_type(btr_cur_get_page(cursor)) == FIL_PAGE_INDEX);
+	ut_ad(btr_page_get_index_id(btr_cur_get_page(cursor)) == index->id);
 
 	offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
 #ifdef UNIV_DEBUG
@@ -2062,6 +2067,8 @@ btr_cur_optimistic_update(
 	ut_ad(!thr || thr_get_trx(thr)->id == trx_id);
 	ut_ad(thr || flags == (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG
 			       | BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG));
+	ut_ad(fil_page_get_type(page) == FIL_PAGE_INDEX);
+	ut_ad(btr_page_get_index_id(page) == index->id);
 
 	heap = mem_heap_create(1024);
 	offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);

=== modified file 'storage/innobase/page/page0cur.cc'
--- a/storage/innobase/page/page0cur.cc	revid:jorgen.loland@stripped4gc1iosh2n6ba
+++ b/storage/innobase/page/page0cur.cc	revid:marko.makela@strippedf
@@ -973,6 +973,9 @@ page_cur_insert_rec_low(
 	page = page_align(current_rec);
 	ut_ad(dict_table_is_comp(index->table)
 	      == (ibool) !!page_is_comp(page));
+	ut_ad(fil_page_get_type(page) == FIL_PAGE_INDEX);
+	ut_ad(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID)
+	      == index->id || mtr->inside_ibuf || recv_recovery_is_on());
 
 	ut_ad(!page_rec_is_supremum(current_rec));
 
@@ -1246,6 +1249,9 @@ page_cur_insert_rec_zip(
 	page = page_align(*current_rec);
 	ut_ad(dict_table_is_comp(index->table));
 	ut_ad(page_is_comp(page));
+	ut_ad(fil_page_get_type(page) == FIL_PAGE_INDEX);
+	ut_ad(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID)
+	      == index->id || mtr->inside_ibuf || recv_recovery_is_on());
 
 	ut_ad(!page_rec_is_supremum(*current_rec));
 #ifdef UNIV_ZIP_DEBUG
@@ -1897,6 +1903,9 @@ page_cur_delete_rec(
 	current_rec = cursor->rec;
 	ut_ad(rec_offs_validate(current_rec, index, offsets));
 	ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table));
+	ut_ad(fil_page_get_type(page) == FIL_PAGE_INDEX);
+	ut_ad(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID)
+	      == index->id || mtr->inside_ibuf || recv_recovery_is_on());
 
 	/* The record must not be the supremum or infimum record. */
 	ut_ad(page_rec_is_user_rec(current_rec));

=== modified file 'storage/innobase/row/row0sel.cc'
--- a/storage/innobase/row/row0sel.cc	revid:jorgen.loland@strippedd4gc1iosh2n6ba
+++ b/storage/innobase/row/row0sel.cc	revid:marko.makela@stripped
@@ -4330,6 +4330,9 @@ wrong_offs:
 
 	/* Calculate the 'offsets' associated with 'rec' */
 
+	ut_ad(fil_page_get_type(btr_pcur_get_page(pcur)) == FIL_PAGE_INDEX);
+	ut_ad(btr_page_get_index_id(btr_pcur_get_page(pcur)) == index->id);
+
 	offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
 
 	if (UNIV_UNLIKELY(srv_force_recovery > 0)) {

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (marko.makela:3829 to 3830) Bug#14058373marko.makela20 May