List:Commits« Previous MessageNext Message »
From:marko.makela Date:January 26 2012 12:01pm
Subject:bzr push into mysql-trunk branch (marko.makela:3794 to 3795)
View as plain text  
 3795 Marko Mäkelä	2012-01-26 [merge]
      Merge mysql-5.5 to mysql-trunk.

    modified:
      storage/innobase/btr/btr0btr.cc
      storage/innobase/btr/btr0cur.cc
      storage/innobase/buf/buf0buf.cc
      storage/innobase/ibuf/ibuf0ibuf.cc
      storage/innobase/include/btr0btr.h
      storage/innobase/include/mtr0log.ic
      storage/innobase/lock/lock0lock.cc
      storage/innobase/page/page0page.cc
      storage/innobase/row/row0ins.cc
      storage/innobase/row/row0sel.cc
      storage/innobase/row/row0umod.cc
      storage/innobase/row/row0upd.cc
      storage/innobase/srv/srv0srv.cc
      storage/innobase/trx/trx0purge.cc
      storage/innobase/trx/trx0rec.cc
 3794 Martin Hansson	2012-01-26
      Bug#13536661: Moved the test case to optimizer_debug_sync (currently decativated).

    modified:
      mysql-test/r/optimizer_debug_sync.result
      mysql-test/t/optimizer_debug_sync.test
      mysql-test/t/temp_table.test
=== modified file 'storage/innobase/btr/btr0btr.cc'
--- a/storage/innobase/btr/btr0btr.cc	revid:martin.hansson@strippedp8jsexzdmmre7ub
+++ b/storage/innobase/btr/btr0btr.cc	revid:marko.makela@strippedc
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2012, Oracle and/or its affiliates. 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
@@ -43,6 +43,27 @@ Created 6/2/1994 Heikki Tuuri
 #include "trx0trx.h"
 #include "srv0mon.h"
 
+/**************************************************************//**
+Report that an index page is corrupted. */
+UNIV_INTERN
+void
+btr_corruption_report(
+/*==================*/
+	const buf_block_t*	block,	/*!< in: corrupted block */
+	const dict_index_t*	index)	/*!< in: index tree */
+{
+	fprintf(stderr, "InnoDB: flag mismatch in space %u page %u"
+		" index %s of table %s\n",
+		(unsigned) buf_block_get_space(block),
+		(unsigned) buf_block_get_page_no(block),
+		index->name, index->table_name);
+	buf_page_print(buf_block_get_frame(block), 0);
+	if (block->page.zip.data) {
+		buf_page_print(block->page.zip.data,
+			       buf_block_get_zip_size(block));
+	}
+}
+
 #ifdef UNIV_BLOB_DEBUG
 # include "srv0srv.h"
 # include "ut0rbt.h"
@@ -693,8 +714,7 @@ btr_root_block_get(
 
 	block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
 			      index, mtr);
-	ut_a((ibool)!!page_is_comp(buf_block_get_frame(block))
-	     == dict_table_is_comp(index->table));
+	btr_assert_not_corrupted(block, index);
 #ifdef UNIV_BTR_DEBUG
 	if (!dict_index_is_ibuf(index)) {
 		const page_t*	root = buf_block_get_frame(block);
@@ -1717,7 +1737,7 @@ btr_page_reorganize_low(
 	ibool		success		= FALSE;
 
 	ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
-	ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table));
+	btr_assert_not_corrupted(block, index);
 #ifdef UNIV_ZIP_DEBUG
 	ut_a(!page_zip || page_zip_validate(page_zip, page));
 #endif /* UNIV_ZIP_DEBUG */
@@ -3347,7 +3367,7 @@ btr_compress(
 	page = btr_cur_get_page(cursor);
 	index = btr_cur_get_index(cursor);
 
-	ut_a((ibool) !!page_is_comp(page) == dict_table_is_comp(index->table));
+	btr_assert_not_corrupted(block, index);
 
 	ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
 				MTR_MEMO_X_LOCK));

=== modified file 'storage/innobase/btr/btr0cur.cc'
--- a/storage/innobase/btr/btr0cur.cc	revid:martin.hansson@strippedexzdmmre7ub
+++ b/storage/innobase/btr/btr0cur.cc	revid:marko.makela@stripped
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -768,11 +768,11 @@ retry_page_get:
 
 	if (level != 0) {
 		/* x-latch the page */
-		page = btr_page_get(
+		buf_block_t*	child_block = btr_block_get(
 			space, zip_size, page_no, RW_X_LATCH, index, mtr);
 
-		ut_a((ibool)!!page_is_comp(page)
-		     == dict_table_is_comp(index->table));
+		page = buf_block_get_frame(child_block);
+		btr_assert_not_corrupted(child_block, index);
 	} else {
 		cursor->low_match = low_match;
 		cursor->low_bytes = low_bytes;

=== modified file 'storage/innobase/buf/buf0buf.cc'
--- a/storage/innobase/buf/buf0buf.cc	revid:martin.hansson@stripped8jsexzdmmre7ub
+++ b/storage/innobase/buf/buf0buf.cc	revid:marko.makela@stripped
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -690,6 +690,8 @@ buf_page_print(
 #endif /* !UNIV_HOTBACKUP */
 	ulint		size = zip_size;
 
+	ut_ad(0);
+
 	if (!size) {
 		size = UNIV_PAGE_SIZE;
 	}

=== modified file 'storage/innobase/ibuf/ibuf0ibuf.cc'
--- a/storage/innobase/ibuf/ibuf0ibuf.cc	revid:martin.hansson@stripped
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc	revid:marko.makela@oracle.com-20120126115753-1dob1syp9kdw461c
@@ -3753,6 +3753,7 @@ ibuf_insert_to_index_page_low(
 
 	fputs("InnoDB: Submit a detailed bug report"
 	      " to http://bugs.mysql.com\n", stderr);
+	ut_ad(0);
 }
 
 /************************************************************************
@@ -3946,6 +3947,11 @@ ibuf_set_del_mark(
 							  TRUE, mtr);
 		}
 	} else {
+		const page_t*		page
+			= page_cur_get_page(&page_cur);
+		const buf_block_t*	block
+			= page_cur_get_block(&page_cur);
+
 		ut_print_timestamp(stderr);
 		fputs("  InnoDB: unable to find a record to delete-mark\n",
 		      stderr);
@@ -3954,10 +3960,14 @@ ibuf_set_del_mark(
 		fputs("\n"
 		      "InnoDB: record ", stderr);
 		rec_print(stderr, page_cur_get_rec(&page_cur), index);
-		putc('\n', stderr);
-		fputs("\n"
-		      "InnoDB: Submit a detailed bug report"
-		      " to http://bugs.mysql.com\n", stderr);
+		fprintf(stderr, "\nspace %u offset %u"
+			" (%u records, index id %llu)\n"
+			"InnoDB: Submit a detailed bug report"
+			" to http://bugs.mysql.com\n",
+			(unsigned) buf_block_get_space(block),
+			(unsigned) buf_block_get_page_no(block),
+			(unsigned) page_get_n_recs(page),
+			btr_page_get_index_id(page));
 		ut_ad(0);
 	}
 }
@@ -4001,12 +4011,31 @@ ibuf_delete(
 		offsets = rec_get_offsets(
 			rec, index, offsets, ULINT_UNDEFINED, &heap);
 
-		/* Refuse to delete the last record. */
-		ut_a(page_get_n_recs(page) > 1);
+		if (page_get_n_recs(page) <= 1
+		    || !(REC_INFO_DELETED_FLAG
+			 & rec_get_info_bits(rec, page_is_comp(page)))) {
+			/* Refuse to purge the last record or a
+			record that has not been marked for deletion. */
+			ut_print_timestamp(stderr);
+			fputs("  InnoDB: unable to purge a record\n",
+			      stderr);
+			fputs("InnoDB: tuple ", stderr);
+			dtuple_print(stderr, entry);
+			fputs("\n"
+			      "InnoDB: record ", stderr);
+			rec_print_new(stderr, rec, offsets);
+			fprintf(stderr, "\nspace %u offset %u"
+				" (%u records, index id %llu)\n"
+				"InnoDB: Submit a detailed bug report"
+				" to http://bugs.mysql.com\n",
+				(unsigned) buf_block_get_space(block),
+				(unsigned) buf_block_get_page_no(block),
+				(unsigned) page_get_n_recs(page),
+				btr_page_get_index_id(page));
 
-		/* The record should have been marked for deletion. */
-		ut_ad(REC_INFO_DELETED_FLAG
-		      & rec_get_info_bits(rec, page_is_comp(page)));
+			ut_ad(0);
+			return;
+		}
 
 		lock_update_delete(block, rec);
 
@@ -4092,6 +4121,7 @@ ibuf_restore_pos(
 
 		fprintf(stderr, "InnoDB: ibuf tree ok\n");
 		fflush(stderr);
+		ut_ad(0);
 	}
 
 	return(FALSE);

=== modified file 'storage/innobase/include/btr0btr.h'
--- a/storage/innobase/include/btr0btr.h	revid:martin.hansson@stripped9p8jsexzdmmre7ub
+++ b/storage/innobase/include/btr0btr.h	revid:marko.makela@strippedw461c
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2012, Oracle and/or its affiliates. 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
@@ -92,6 +92,26 @@ insert/delete buffer when the record is
 buffer when the record is not in the buffer pool. */
 #define BTR_DELETE		8192
 
+/**************************************************************//**
+Report that an index page is corrupted. */
+UNIV_INTERN
+void
+btr_corruption_report(
+/*==================*/
+	const buf_block_t*	block,	/*!< in: corrupted block */
+	const dict_index_t*	index)	/*!< in: index tree */
+	UNIV_COLD __attribute__((nonnull));
+
+/** Assert that a B-tree page is not corrupted.
+@param block buffer block containing a B-tree page
+@param index the B-tree index */
+#define btr_assert_not_corrupted(block, index)			\
+	if ((ibool) !!page_is_comp(buf_block_get_frame(block))	\
+	    != dict_table_is_comp((index)->table)) {		\
+		btr_corruption_report(block, index);		\
+		ut_error;					\
+	}
+
 #ifdef UNIV_BLOB_DEBUG
 # include "ut0rbt.h"
 /** An index->blobs entry for keeping track of off-page column references */

=== modified file 'storage/innobase/include/mtr0log.ic'
--- a/storage/innobase/include/mtr0log.ic	revid:martin.hansson@stripped
+++ b/storage/innobase/include/mtr0log.ic	revid:marko.makela@stripped
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2012, Oracle and/or its affiliates. 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
@@ -217,6 +217,7 @@ mlog_write_initial_log_record_fast(
 				"Please post a bug report to "
 				"bugs.mysql.com.\n",
 				type, offset, space);
+			ut_ad(0);
 		}
 	}
 

=== modified file 'storage/innobase/lock/lock0lock.cc'
--- a/storage/innobase/lock/lock0lock.cc	revid:martin.hansson@stripped
+++ b/storage/innobase/lock/lock0lock.cc	revid:marko.makela@oracle.com-20120126115753-1dob1syp9kdw461c
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2012, Oracle and/or its affiliates. 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
@@ -1760,7 +1760,7 @@ lock_rec_create(
 	page_no	= buf_block_get_page_no(block);
 	page = block->frame;
 
-	ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table));
+	btr_assert_not_corrupted(block, index);
 
 	/* If rec is the supremum record, then we reset the gap and
 	LOCK_REC_NOT_GAP bits, as all locks on the supremum are
@@ -1885,6 +1885,7 @@ lock_rec_enqueue_waiting(
 		      "InnoDB: Submit a detailed bug report"
 		      " to http://bugs.mysql.com\n",
 		      stderr);
+		ut_ad(0);
 	}
 
 	/* Enqueue the lock request that will wait to be granted, note that
@@ -4238,6 +4239,7 @@ lock_table_enqueue_waiting(
 		      "InnoDB: Submit a detailed bug report"
 		      " to http://bugs.mysql.com\n",
 		      stderr);
+		ut_ad(0);
 	}
 
 	/* Enqueue the lock request that will wait to be granted */

=== modified file 'storage/innobase/page/page0page.cc'
--- a/storage/innobase/page/page0page.cc	revid:martin.hansson@strippedmmre7ub
+++ b/storage/innobase/page/page0page.cc	revid:marko.makela@stripped
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2012, Oracle and/or its affiliates. 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
@@ -549,8 +549,7 @@ page_copy_rec_list_end_no_locks(
 		page_cur_move_to_next(&cur1);
 	}
 
-	ut_a((ibool)!!page_is_comp(new_page)
-	     == dict_table_is_comp(index->table));
+	btr_assert_not_corrupted(new_block, index);
 	ut_a(page_is_comp(new_page) == page_rec_is_comp(rec));
 	ut_a(mach_read_from_2(new_page + UNIV_PAGE_SIZE - 10) == (ulint)
 	     (page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM));

=== modified file 'storage/innobase/row/row0ins.cc'
--- a/storage/innobase/row/row0ins.cc	revid:martin.hansson@stripped8jsexzdmmre7ub
+++ b/storage/innobase/row/row0ins.cc	revid:marko.makela@stripped
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2012, Oracle and/or its affiliates. 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
@@ -1070,7 +1070,7 @@ row_ins_foreign_check_on_constraint(
 			fputs("\n"
 			      "InnoDB: Submit a detailed bug report to"
 			      " http://bugs.mysql.com\n", stderr);
-
+			ut_ad(0);
 			err = DB_SUCCESS;
 
 			goto nonstandard_exit_func;

=== modified file 'storage/innobase/row/row0sel.cc'
--- a/storage/innobase/row/row0sel.cc	revid:martin.hansson@stripped9p8jsexzdmmre7ub
+++ b/storage/innobase/row/row0sel.cc	revid:marko.makela@stripped1c
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -3123,6 +3123,7 @@ row_sel_get_clust_rec_for_mysql(
 			fputs("\n"
 			      "InnoDB: Submit a detailed bug report"
 			      " to http://bugs.mysql.com\n", stderr);
+			ut_ad(0);
 		}
 
 		clust_rec = NULL;

=== modified file 'storage/innobase/row/row0umod.cc'
--- a/storage/innobase/row/row0umod.cc	revid:martin.hansson@stripped
+++ b/storage/innobase/row/row0umod.cc	revid:marko.makela@oracle.com-20120126115753-1dob1syp9kdw461c
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2012, Oracle and/or its affiliates. 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
@@ -509,6 +509,7 @@ row_undo_mod_del_unmark_sec_and_undo_upd
 		fputs("\n"
 		      "InnoDB: Submit a detailed bug report"
 		      " to http://bugs.mysql.com\n", stderr);
+		ut_ad(0);
 		break;
 	case ROW_FOUND:
 		btr_cur = btr_pcur_get_btr_cur(&pcur);

=== modified file 'storage/innobase/row/row0upd.cc'
--- a/storage/innobase/row/row0upd.cc	revid:martin.hansson@strippedmmre7ub
+++ b/storage/innobase/row/row0upd.cc	revid:marko.makela@stripped
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2012, Oracle and/or its affiliates. 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
@@ -1723,6 +1723,7 @@ row_upd_sec_index_entry(
 		fputs("\n"
 		      "InnoDB: Submit a detailed bug report"
 		      " to http://bugs.mysql.com\n", stderr);
+		ut_ad(0);
 		break;
 	case ROW_FOUND:
 		/* Delete mark the old index record; it can already be

=== modified file 'storage/innobase/srv/srv0srv.cc'
--- a/storage/innobase/srv/srv0srv.cc	revid:martin.hansson@stripped3435-9p8jsexzdmmre7ub
+++ b/storage/innobase/srv/srv0srv.cc	revid:marko.makela@strippedkdw461c
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, 2009 Google Inc.
 Copyright (c) 2009, Percona Inc.
 
@@ -1594,6 +1594,7 @@ loop:
 			"InnoDB: Please submit a bug report"
 			" to http://bugs.mysql.com\n",
 			old_lsn, new_lsn);
+		ut_ad(0);
 	}
 
 	old_lsn = new_lsn;

=== modified file 'storage/innobase/trx/trx0purge.cc'
--- a/storage/innobase/trx/trx0purge.cc	revid:martin.hansson@strippedom-20120126113435-9p8jsexzdmmre7ub
+++ b/storage/innobase/trx/trx0purge.cc	revid:marko.makela@stripped15753-1dob1syp9kdw461c
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2012, Oracle and/or its affiliates. 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
@@ -603,6 +603,7 @@ trx_purge_rseg_get_next_history_log(
 				"InnoDB: report, and submit it"
 				" to http://bugs.mysql.com\n",
 				(ulong) trx_sys->rseg_history_len);
+			ut_ad(0);
 		}
 
 		mutex_exit(&trx_sys->mutex);

=== modified file 'storage/innobase/trx/trx0rec.cc'
--- a/storage/innobase/trx/trx0rec.cc	revid:martin.hansson@stripped-9p8jsexzdmmre7ub
+++ b/storage/innobase/trx/trx0rec.cc	revid:marko.makela@stripped61c
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2012, Oracle and/or its affiliates. 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
@@ -1009,6 +1009,7 @@ trx_undo_update_rec_get_update(
 			fprintf(stderr, "\n"
 				"InnoDB: n_fields = %lu, i = %lu, ptr %p\n",
 				(ulong) n_fields, (ulong) i, ptr);
+			ut_ad(0);
 			*upd = NULL;
 			return(NULL);
 		}

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (marko.makela:3794 to 3795) marko.makela30 Jan