List:Commits« Previous MessageNext Message »
From:marko.makela Date:April 13 2011 8:34am
Subject:bzr push into mysql-trunk-innodb branch (marko.makela:3577 to 3580)
View as plain text  
 3580 Marko Mäkelä	2011-04-13
      Allow the code to compile when UNIV_HOTBACKUP is defined.
      
      rb:648 approved by Jimmy Yang

    modified:
      storage/innobase/btr/btr0btr.c
      storage/innobase/buf/buf0buf.c
      storage/innobase/buf/buf0lru.c
      storage/innobase/dict/dict0dict.c
      storage/innobase/dict/dict0mem.c
      storage/innobase/ha/ha0ha.c
      storage/innobase/include/buf0buf.ic
      storage/innobase/include/buf0flu.h
      storage/innobase/include/buf0lru.h
      storage/innobase/include/dict0dict.ic
      storage/innobase/include/dict0priv.ic
      storage/innobase/include/log0log.h
      storage/innobase/include/os0file.h
      storage/innobase/include/srv0srv.h
      storage/innobase/include/trx0sys.h
      storage/innobase/log/log0recv.c
      storage/innobase/mem/mem0dbg.c
      storage/innobase/page/page0zip.c
      storage/innobase/trx/trx0sys.c
      storage/innobase/ut/ut0dbg.c
      storage/innobase/ut/ut0ut.c
 3579 Marko Mäkelä	2011-04-13
      Suppress the Bug #58815 (Bug #11765812) assertion failure.
      
      buf_page_get_gen(): Introduce BUF_GET_POSSIBLY_FREED for suppressing the
      check that the file page must not have been freed.
      
      btr_estimate_n_rows_in_range_on_level(): Pass BUF_GET_POSSIBLY_FREED and
      explain in the comments why this is needed and why it should be mostly
      harmless to ignore the problem. If InnoDB had always initialized all
      unused fields in data files, no problem would exist.
      
      This change does not fix the bug, it just "shoots the messenger".
      
      rb:647 approved by Jimmy Yang

    modified:
      storage/innobase/btr/btr0cur.c
      storage/innobase/buf/buf0buf.c
      storage/innobase/include/buf0buf.h
 3578 Marko Mäkelä	2011-04-13
      Remove race conditions in debug code.
      
      In earlier versions of InnoDB, the debug flag buf_page_t::file_page_was_freed
      is protected by the buffer pool mutex. In mysql-trunk, it was not properly
      protected by any mutex, after the buf_pool->page_hash rw-lock offloaded some
      work from the buffer pool mutex.
      
      Protect buf_page_t::file_page_was_freed with the block mutex.
      
      rb:647 approved by Jimmy Yang

    modified:
      storage/innobase/buf/buf0buf.c
      storage/innobase/include/buf0buf.h
 3577 Jimmy Yang	2011-04-12
      Remove obsoleted "syn_arr_mutex_key", since the sync arrary mutex is changed
      to an OS mutex in Bug 12348462.
      
      Approved by Marko

    modified:
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/sync0sync.h
      storage/innobase/sync/sync0arr.c
=== modified file 'storage/innobase/btr/btr0btr.c'
--- a/storage/innobase/btr/btr0btr.c	revid:jimmy.yang@stripped46-ma35etb6imzp2tyl
+++ b/storage/innobase/btr/btr0btr.c	revid:marko.makela@strippedybjz
@@ -1515,7 +1515,9 @@ btr_page_reorganize_low(
 	dict_index_t*	index,	/*!< in: record descriptor */
 	mtr_t*		mtr)	/*!< in: mtr */
 {
+#ifndef UNIV_HOTBACKUP
 	buf_pool_t*	buf_pool	= buf_pool_from_bpage(&block->page);
+#endif /* !UNIV_HOTBACKUP */
 	page_t*		page		= buf_block_get_frame(block);
 	page_zip_des_t*	page_zip	= buf_block_get_page_zip(block);
 	buf_block_t*	temp_block;

=== modified file 'storage/innobase/btr/btr0cur.c'
--- a/storage/innobase/btr/btr0cur.c	revid:jimmy.yang@stripped32746-ma35etb6imzp2tyl
+++ b/storage/innobase/btr/btr0cur.c	revid:marko.makela@strippeduwlybjz
@@ -3264,9 +3264,14 @@ btr_estimate_n_rows_in_range_on_level(
 
 		mtr_start(&mtr);
 
-		/* fetch the page */
-		block = buf_page_get(space, zip_size, page_no, RW_S_LATCH,
-				     &mtr);
+		/* Fetch the page. Because we are not holding the
+		index->lock, the tree may have changed and we may be
+		attempting to read a page that is no longer part of
+		the B-tree. We pass BUF_GET_POSSIBLY_FREED in order to
+		silence a debug assertion about this. */
+		block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH,
+					 NULL, BUF_GET_POSSIBLY_FREED,
+					 __FILE__, __LINE__, &mtr);
 
 		page = buf_block_get_frame(block);
 
@@ -3285,6 +3290,13 @@ btr_estimate_n_rows_in_range_on_level(
 			goto inexact;
 		}
 
+		/* It is possible but highly unlikely that the page was
+		originally written by an old version of InnoDB that did
+		not initialize FIL_PAGE_TYPE on other than B-tree pages.
+		For example, this could be an almost-empty BLOB page
+		that happens to contain the magic values in the fields
+		that we checked above. */
+
 		n_pages_read++;
 
 		if (page_no != slot1->page_no) {

=== modified file 'storage/innobase/buf/buf0buf.c'
--- a/storage/innobase/buf/buf0buf.c	revid:jimmy.yang@strippedtyl
+++ b/storage/innobase/buf/buf0buf.c	revid:marko.makela@stripped
@@ -294,7 +294,6 @@ be effective only if PFS_GROUP_BUFFER_SY
 
 # endif /* !PFS_SKIP_BUFFER_MUTEX_RWLOCK */
 #endif /* UNIV_PFS_MUTEX || UNIV_PFS_RWLOCK */
-#endif /* !UNIV_HOTBACKUP */
 
 /** Macro to determine whether the read of write counter is used depending
 on the io_type */
@@ -445,6 +444,7 @@ buf_block_alloc(
 
 	return(block);
 }
+#endif /* !UNIV_HOTBACKUP */
 
 /********************************************************************//**
 Calculates a page checksum which is stored to the page when it is written
@@ -2366,11 +2366,14 @@ buf_page_set_file_page_was_freed(
 					   &hash_lock);
 
 	if (bpage) {
+		mutex_t*	block_mutex = buf_page_get_mutex(bpage);
 		ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage));
+		mutex_enter(block_mutex);
+		rw_lock_s_unlock(hash_lock);
 		/* bpage->file_page_was_freed can already hold
 		when this code is invoked from dict_drop_index_tree() */
 		bpage->file_page_was_freed = TRUE;
-		rw_lock_s_unlock(hash_lock);
+		mutex_exit(block_mutex);
 	}
 
 	return(bpage);
@@ -2396,9 +2399,12 @@ buf_page_reset_file_page_was_freed(
 	bpage = buf_page_hash_get_s_locked(buf_pool, space, offset,
 					   &hash_lock);
 	if (bpage) {
+		mutex_t*	block_mutex = buf_page_get_mutex(bpage);
 		ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage));
-		bpage->file_page_was_freed = FALSE;
+		mutex_enter(block_mutex);
 		rw_lock_s_unlock(hash_lock);
+		bpage->file_page_was_freed = FALSE;
+		mutex_exit(block_mutex);
 	}
 
 	return(bpage);
@@ -2534,13 +2540,12 @@ got_block:
 	access_time = buf_page_is_accessed(bpage);
 
 	rw_lock_s_unlock(hash_lock);
-	mutex_exit(block_mutex);
-
-	buf_page_set_accessed_make_young(bpage, access_time);
-
 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
 	ut_a(!bpage->file_page_was_freed);
 #endif
+	mutex_exit(block_mutex);
+
+	buf_page_set_accessed_make_young(bpage, access_time);
 
 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
 	ut_a(++buf_dbg_counter % 5771 || buf_validate());
@@ -2897,6 +2902,7 @@ buf_page_get_gen(
 	case BUF_GET_IF_IN_POOL:
 	case BUF_PEEK_IF_IN_POOL:
 	case BUF_GET_IF_IN_POOL_OR_WATCH:
+	case BUF_GET_POSSIBLY_FREED:
 		break;
 	default:
 		ut_error;
@@ -3279,7 +3285,10 @@ wait_until_unfixed:
 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
 
 	buf_block_buf_fix_inc(block, file, line);
-
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
+	ut_a(mode == BUF_GET_POSSIBLY_FREED
+	     || !block->page.file_page_was_freed);
+#endif
 	mutex_exit(&block->mutex);
 
 	/* Check if this is the first access to the page */
@@ -3290,10 +3299,6 @@ wait_until_unfixed:
 		buf_page_set_accessed_make_young(&block->page, access_time);
 	}
 
-#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
-	ut_a(!block->page.file_page_was_freed);
-#endif
-
 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
 	ut_a(++buf_dbg_counter % 5771 || buf_validate());
 	ut_a(block->page.buf_fix_count > 0);
@@ -3370,8 +3375,7 @@ buf_page_optimistic_get(
 /*====================*/
 	ulint		rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH */
 	buf_block_t*	block,	/*!< in: guessed buffer block */
-	ib_uint64_t	modify_clock,/*!< in: modify clock value if mode is
-				..._GUESS_ON_CLOCK */
+	ib_uint64_t	modify_clock,/*!< in: modify clock value */
 	const char*	file,	/*!< in: file name */
 	ulint		line,	/*!< in: line where called */
 	mtr_t*		mtr)	/*!< in: mini-transaction */
@@ -3455,8 +3459,11 @@ buf_page_optimistic_get(
 #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
 
 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
-	ut_a(block->page.file_page_was_freed == FALSE);
+	mutex_enter(&block->mutex);
+	ut_a(!block->page.file_page_was_freed);
+	mutex_exit(&block->mutex);
 #endif
+
 	if (UNIV_UNLIKELY(!access_time)) {
 		/* In the case of a first access, try to apply linear
 		read-ahead */
@@ -3568,7 +3575,9 @@ buf_page_get_known_nowait(
 	ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
 #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
-	ut_a(block->page.file_page_was_freed == FALSE);
+	mutex_enter(&block->mutex);
+	ut_a(!block->page.file_page_was_freed);
+	mutex_exit(&block->mutex);
 #endif
 
 #ifdef UNIV_IBUF_COUNT_DEBUG
@@ -3657,7 +3666,9 @@ buf_page_try_get_func(
 	ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
 #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
-	ut_a(block->page.file_page_was_freed == FALSE);
+	mutex_enter(&block->mutex);
+	ut_a(!block->page.file_page_was_freed);
+	mutex_exit(&block->mutex);
 #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
 	buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
 

=== modified file 'storage/innobase/buf/buf0lru.c'
--- a/storage/innobase/buf/buf0lru.c	revid:jimmy.yang@stripped5etb6imzp2tyl
+++ b/storage/innobase/buf/buf0lru.c	revid:marko.makela@stripped
@@ -25,6 +25,7 @@ Created 11/5/1995 Heikki Tuuri
 
 #include "buf0lru.h"
 
+#ifndef UNIV_HOTBACKUP
 #ifdef UNIV_NONINL
 #include "buf0lru.ic"
 #endif
@@ -2390,3 +2391,4 @@ buf_LRU_print(void)
 	}
 }
 #endif /* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */
+#endif /* !UNIV_HOTBACKUP */

=== modified file 'storage/innobase/dict/dict0dict.c'
--- a/storage/innobase/dict/dict0dict.c	revid:jimmy.yang@stripped
+++ b/storage/innobase/dict/dict0dict.c	revid:marko.makela@strippedom-20110413083416-i98bfd2h3uwlybjz
@@ -5111,6 +5111,7 @@ dict_ind_init(void)
 	dict_ind_redundant->cached = dict_ind_compact->cached = TRUE;
 }
 
+#ifndef UNIV_HOTBACKUP
 /**********************************************************************//**
 Frees dict_ind_redundant and dict_ind_compact. */
 static
@@ -5131,7 +5132,6 @@ dict_ind_free(void)
 	dict_mem_table_free(table);
 }
 
-#ifndef UNIV_HOTBACKUP
 /**********************************************************************//**
 Get index by name
 @return	index, NULL if does not exist */

=== modified file 'storage/innobase/dict/dict0mem.c'
--- a/storage/innobase/dict/dict0mem.c	revid:jimmy.yang@stripped5etb6imzp2tyl
+++ b/storage/innobase/dict/dict0mem.c	revid:marko.makela@stripped
@@ -34,8 +34,8 @@ Created 1/8/1996 Heikki Tuuri
 #include "mach0data.h"
 #include "dict0dict.h"
 #include "srv0srv.h" /* srv_lower_case_table_names */
-#include "ha_prototypes.h" /* innobase_casedn_str()*/
 #ifndef UNIV_HOTBACKUP
+# include "ha_prototypes.h" /* innobase_casedn_str()*/
 # include "lock0lock.h"
 #endif /* !UNIV_HOTBACKUP */
 #ifdef UNIV_BLOB_DEBUG
@@ -275,6 +275,7 @@ dict_mem_index_create(
 	return(index);
 }
 
+#ifndef UNIV_HOTBACKUP
 /**********************************************************************//**
 Creates and initializes a foreign constraint memory object.
 @return	own: foreign constraint struct */
@@ -348,6 +349,7 @@ dict_mem_referenced_table_name_lookup_se
 			= foreign->referenced_table_name;
 	}
 }
+#endif /* !UNIV_HOTBACKUP */
 
 /**********************************************************************//**
 Adds a field definition to an index. NOTE: does not take a copy

=== modified file 'storage/innobase/ha/ha0ha.c'
--- a/storage/innobase/ha/ha0ha.c	revid:jimmy.yang@stripped-20110412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/ha/ha0ha.c	revid:marko.makela@stripped8bfd2h3uwlybjz
@@ -31,7 +31,9 @@ Created 8/22/1994 Heikki Tuuri
 #ifdef UNIV_DEBUG
 # include "buf0buf.h"
 #endif /* UNIV_DEBUG */
-#include "btr0sea.h"
+#ifndef UNIV_HOTBACKUP
+# include "btr0sea.h"
+#endif /* !UNIV_HOTBACKUP */
 #include "page0page.h"
 
 /*************************************************************//**
@@ -223,12 +225,14 @@ ha_insert_for_fold_func(
 		prev_node = prev_node->next;
 	}
 
+#ifndef UNIV_HOTBACKUP
 	/* We are in the process of disabling hash index, do not add
 	new chain node */
 	if (!btr_search_enabled) {
 		ut_ad(!btr_search_fully_disabled);
 		return(TRUE);
 	}
+#endif /* !UNIV_HOTBACKUP */
 
 	/* We have to allocate a new chain node */
 

=== modified file 'storage/innobase/include/buf0buf.h'
--- a/storage/innobase/include/buf0buf.h	revid:jimmy.yang@oracle.com-20110412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/include/buf0buf.h	revid:marko.makela@stripped0110413083416-i98bfd2h3uwlybjz
@@ -54,6 +54,9 @@ Created 11/5/1995 Heikki Tuuri
 					/*!< Get the page only if it's in the
 					buffer pool, if not then set a watch
 					on the page. */
+#define BUF_GET_POSSIBLY_FREED		16
+					/*!< Like BUF_GET, but do not mind
+					if the file page has been freed. */
 /* @} */
 /** @name Modes for buf_page_get_known_nowait */
 /* @{ */
@@ -331,8 +334,7 @@ buf_page_optimistic_get(
 /*====================*/
 	ulint		rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH */
 	buf_block_t*	block,	/*!< in: guessed block */
-	ib_uint64_t	modify_clock,/*!< in: modify clock value if mode is
-				..._GUESS_ON_CLOCK */
+	ib_uint64_t	modify_clock,/*!< in: modify clock value */
 	const char*	file,	/*!< in: file name */
 	ulint		line,	/*!< in: line where called */
 	mtr_t*		mtr);	/*!< in: mini-transaction */
@@ -1496,8 +1498,10 @@ struct buf_page_struct{
 	/* @} */
 # if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
 	ibool		file_page_was_freed;
-					/*!< this is set to TRUE when fsp
-					frees a page in buffer pool */
+					/*!< this is set to TRUE when
+					fsp frees a page in buffer pool;
+					protected by buf_pool->zip_mutex
+					or buf_block_struct::mutex. */
 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
 #endif /* !UNIV_HOTBACKUP */
 };

=== modified file 'storage/innobase/include/buf0buf.ic'
--- a/storage/innobase/include/buf0buf.ic	revid:jimmy.yang@stripped20110412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/include/buf0buf.ic	revid:marko.makela@stripped3416-i98bfd2h3uwlybjz
@@ -35,6 +35,7 @@ Created 11/5/1995 Heikki Tuuri
 #include "buf0lru.h"
 #include "buf0rea.h"
 
+#ifndef UNIV_HOTBACKUP
 /** A chunk of buffers. The buffer pool is allocated in chunks. */
 struct buf_chunk_struct{
 	ulint		mem_size;	/*!< allocated size of the chunk */
@@ -171,6 +172,7 @@ buf_page_peek_if_too_old(
 			     / (BUF_LRU_OLD_RATIO_DIV * 4))));
 	}
 }
+#endif /* !UNIV_HOTBACKUP */
 
 /*********************************************************************//**
 Gets the state of a block.
@@ -1076,7 +1078,8 @@ buf_page_hash_get_locked(
 
 	bpage = buf_page_hash_get_low(buf_pool, space, offset, fold);
 
-	if (!bpage || UNIV_UNLIKELY(buf_pool_watch_is_sentinel(buf_pool, bpage))) {
+	if (!bpage
+	    || UNIV_UNLIKELY(buf_pool_watch_is_sentinel(buf_pool, bpage))) {
 		bpage = NULL;
 		goto unlock_and_exit;
 	}
@@ -1221,7 +1224,6 @@ buf_page_release_zip(
 		break;
 	}
 
-	
 	ut_error;
 }
 

=== modified file 'storage/innobase/include/buf0flu.h'
--- a/storage/innobase/include/buf0flu.h	revid:jimmy.yang@stripped
+++ b/storage/innobase/include/buf0flu.h	revid:marko.makela@stripped
@@ -28,10 +28,10 @@ Created 11/5/1995 Heikki Tuuri
 
 #include "univ.i"
 #include "ut0byte.h"
+#include "log0log.h"
 #ifndef UNIV_HOTBACKUP
 #include "mtr0types.h"
 #include "buf0types.h"
-#include "log0log.h"
 
 /** Flag indicating if the page_cleaner is in active state. */
 extern ibool buf_page_cleaner_is_active;

=== modified file 'storage/innobase/include/buf0lru.h'
--- a/storage/innobase/include/buf0lru.h	revid:jimmy.yang@strippedmzp2tyl
+++ b/storage/innobase/include/buf0lru.h	revid:marko.makela@stripped
@@ -27,6 +27,7 @@ Created 11/5/1995 Heikki Tuuri
 #define buf0lru_h
 
 #include "univ.i"
+#ifndef UNIV_HOTBACKUP
 #include "ut0byte.h"
 #include "buf0types.h"
 
@@ -293,4 +294,6 @@ Increments the page_zip_decompress() cou
 #include "buf0lru.ic"
 #endif
 
+#endif /* !UNIV_HOTBACKUP */
+
 #endif

=== modified file 'storage/innobase/include/dict0dict.ic'
--- a/storage/innobase/include/dict0dict.ic	revid:jimmy.yang@stripped
+++ b/storage/innobase/include/dict0dict.ic	revid:marko.makela@stripped
@@ -490,6 +490,7 @@ dict_table_zip_size(
 	return(dict_table_flags_to_zip_size(table->flags));
 }
 
+#ifndef UNIV_HOTBACKUP
 /*********************************************************************//**
 Obtain exclusive locks on all index trees of the table. This is to prevent
 accessing index trees while InnoDB is updating internal metadata for
@@ -532,6 +533,8 @@ dict_table_x_unlock_indexes(
 		rw_lock_x_unlock(dict_index_get_lock(index));
 	}
 }
+#endif /* !UNIV_HOTBACKUP */
+
 /********************************************************************//**
 Gets the number of fields in the internal representation of an index,
 including fields added by the dictionary system.

=== modified file 'storage/innobase/include/dict0priv.ic'
--- a/storage/innobase/include/dict0priv.ic	revid:jimmy.yang@strippedom-20110412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/include/dict0priv.ic	revid:marko.makela@stripped413083416-i98bfd2h3uwlybjz
@@ -26,6 +26,7 @@ Created  Wed 13 Oct 2010 16:10:14 EST Su
 #include "dict0dict.h"
 #include "dict0load.h"
 #include "dict0priv.h"
+#ifndef UNIV_HOTBACKUP
 
 /**********************************************************************//**
 Gets a table; loads it to the dictionary cache if necessary. A low-level
@@ -107,3 +108,4 @@ dict_table_check_if_in_cache_low(
 		    !strcmp(table->name, table_name));
 	return(table);
 }
+#endif /*! UNIV_HOTBACKUP */

=== modified file 'storage/innobase/include/log0log.h'
--- a/storage/innobase/include/log0log.h	revid:jimmy.yang@strippedb6imzp2tyl
+++ b/storage/innobase/include/log0log.h	revid:marko.makela@stripped
@@ -765,7 +765,6 @@ struct log_struct{
 					buffer */
 #ifndef UNIV_HOTBACKUP
 	mutex_t		mutex;		/*!< mutex protecting the log */
-#endif /* !UNIV_HOTBACKUP */
 
 	mutex_t		log_flush_order_mutex;/*!< mutex to serialize access to
 					the flush list when we are putting
@@ -775,6 +774,7 @@ struct log_struct{
 					mtr_commit and still ensure that
 					insertions in the flush_list happen
 					in the LSN order. */
+#endif /* !UNIV_HOTBACKUP */
 	byte*		buf_ptr;	/* unaligned log buffer */
 	byte*		buf;		/*!< log buffer */
 	ulint		buf_size;	/*!< log buffer size in bytes */

=== modified file 'storage/innobase/include/os0file.h'
--- a/storage/innobase/include/os0file.h	revid:jimmy.yang@stripped
+++ b/storage/innobase/include/os0file.h	revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -308,7 +308,7 @@ to original un-instrumented file I/O API
 # define os_file_create(key, name, create, purpose, type, success)	\
 	os_file_create_func(name, create, purpose, type, success)
 
-# define os_file_create_simple(key, name, create, access, success)	\
+# define os_file_create_simple(key, name, create_mode, access, success)	\
 	os_file_create_simple_func(name, create_mode, access, success)
 
 # define os_file_create_simple_no_error_handling(			\

=== modified file 'storage/innobase/include/srv0srv.h'
--- a/storage/innobase/include/srv0srv.h	revid:jimmy.yang@stripped0110412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/include/srv0srv.h	revid:marko.makela@stripped16-i98bfd2h3uwlybjz
@@ -115,7 +115,6 @@ extern ulint	srv_max_file_format_at_star
 /** Place locks to records only i.e. do not use next-key locking except
 on duplicate key checking and foreign key checking */
 extern ibool	srv_locks_unsafe_for_binlog;
-#endif /* !UNIV_HOTBACKUP */
 
 /* If this flag is TRUE, then we will use the native aio of the
 OS (provided we compiled Innobase with it in), otherwise we will
@@ -125,6 +124,7 @@ extern my_bool	srv_use_native_aio;
 #ifdef __WIN__
 extern ibool	srv_use_native_conditions;
 #endif
+#endif /* !UNIV_HOTBACKUP */
 extern ulint	srv_n_data_files;
 extern char**	srv_data_file_names;
 extern ulint*	srv_data_file_sizes;

=== modified file 'storage/innobase/include/trx0sys.h'
--- a/storage/innobase/include/trx0sys.h	revid:jimmy.yang@stripped0412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/include/trx0sys.h	revid:marko.makela@strippedi98bfd2h3uwlybjz
@@ -632,7 +632,6 @@ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_NO. */
 #define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE	FSP_EXTENT_SIZE
 /* @} */
 
-#ifndef UNIV_HOTBACKUP
 /** File format tag */
 /* @{ */
 /** The offset of the file format tag on the trx system header page
@@ -651,6 +650,7 @@ identifier is added to this 64-bit const
 	 | TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW)
 /* @} */
 
+#ifndef UNIV_HOTBACKUP
 /** Doublewrite control struct */
 struct trx_doublewrite_struct{
 	mutex_t	mutex;		/*!< mutex protecting the first_free field and

=== modified file 'storage/innobase/log/log0recv.c'
--- a/storage/innobase/log/log0recv.c	revid:jimmy.yang@strippedzp2tyl
+++ b/storage/innobase/log/log0recv.c	revid:marko.makela@stripped
@@ -801,8 +801,8 @@ recv_read_checkpoint_info_for_backup(
 	*lsn = mach_read_from_8(cp_buf + LOG_CHECKPOINT_LSN);
 	*offset = mach_read_from_4(
 		cp_buf + LOG_CHECKPOINT_OFFSET_LOW32);
-	*offset |= mach_read_from_4(
-		cp_buf + LOG_CHECKPOINT_OFFSET_HIGH32) << 32;
+	*offset |= ((lsn_t) mach_read_from_4(
+			    cp_buf + LOG_CHECKPOINT_OFFSET_HIGH32)) << 32;
 
 	*cp_no = mach_read_from_8(cp_buf + LOG_CHECKPOINT_NO);
 
@@ -1934,7 +1934,7 @@ recv_apply_log_recs_for_backup(void)
 			if (!success) {
 				fprintf(stderr,
 					"InnoDB: Fatal error: cannot extend"
-					" tablespace %lu to hold %lu pages\n",
+					" tablespace %u to hold %u pages\n",
 					recv_addr->space, recv_addr->page_no);
 
 				exit(1);

=== modified file 'storage/innobase/mem/mem0dbg.c'
--- a/storage/innobase/mem/mem0dbg.c	revid:jimmy.yang@stripped
+++ b/storage/innobase/mem/mem0dbg.c	revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -24,10 +24,9 @@ but is included in mem0mem.* !
 Created 6/9/1994 Heikki Tuuri
 *************************************************************************/
 
-#include "ha_prototypes.h"
-
 #ifdef UNIV_MEM_DEBUG
 # ifndef UNIV_HOTBACKUP
+#  include "ha_prototypes.h"
 /* The mutex which protects in the debug version the hash table
 containing the list of live memory heaps, and also the global
 variables below. */

=== modified file 'storage/innobase/page/page0zip.c'
--- a/storage/innobase/page/page0zip.c	revid:jimmy.yang@oracle.com-20110412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/page/page0zip.c	revid:marko.makela@stripped10413083416-i98bfd2h3uwlybjz
@@ -46,6 +46,7 @@ Created June 2005 by Marko Makela
 #else /* !UNIV_HOTBACKUP */
 # define lock_move_reorganize_page(block, temp_block)	((void) 0)
 # define buf_LRU_stat_inc_unzip()			((void) 0)
+# define MONITOR_INC(x)					((void) 0)
 #endif /* !UNIV_HOTBACKUP */
 
 #ifndef UNIV_HOTBACKUP
@@ -4426,7 +4427,9 @@ page_zip_reorganize(
 	dict_index_t*	index,	/*!< in: index of the B-tree node */
 	mtr_t*		mtr)	/*!< in: mini-transaction */
 {
+#ifndef UNIV_HOTBACKUP
 	buf_pool_t*	buf_pool	= buf_pool_from_block(block);
+#endif /* !UNIV_HOTBACKUP */
 	page_zip_des_t*	page_zip	= buf_block_get_page_zip(block);
 	page_t*		page		= buf_block_get_frame(block);
 	buf_block_t*	temp_block;

=== modified file 'storage/innobase/trx/trx0sys.c'
--- a/storage/innobase/trx/trx0sys.c	revid:jimmy.yang@stripped2tyl
+++ b/storage/innobase/trx/trx0sys.c	revid:marko.makela@stripped
@@ -1429,23 +1429,6 @@ trx_sys_print_mysql_binlog_offset_from_p
 	}
 }
 
-
-/* THESE ARE COPIED FROM NON-HOTBACKUP PART OF THE INNODB SOURCE TREE
-   (This code duplicaton should be fixed at some point!)
-*/
-
-#define	TRX_SYS_SPACE	0	/* the SYSTEM tablespace */
-/* The offset of the file format tag on the trx system header page */
-#define TRX_SYS_FILE_FORMAT_TAG		(UNIV_PAGE_SIZE - 16)
-/* We use these random constants to reduce the probability of reading
-garbage (from previous versions) that maps to an actual format id. We
-use these as bit masks at the time of  reading and writing from/to disk. */
-#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW	3645922177UL
-#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_HIGH	2745987765UL
-
-/* END OF COPIED DEFINITIONS */
-
-
 /*****************************************************************//**
 Reads the file format id from the first system table space file.
 Even if the call succeeds and returns TRUE, the returned format id
@@ -1724,7 +1707,6 @@ trx_sys_close(void)
 
 	trx_sys = NULL;
 }
-#endif /* !UNIV_HOTBACKUP */
 
 /*********************************************************************
 Check if there are any active (non-prepared) transactions.
@@ -1775,3 +1757,4 @@ trx_sys_validate_trx_list(void)
 	return(TRUE);
 }
 #endif /* UNIV_DEBUG */
+#endif /* !UNIV_HOTBACKUP */

=== modified file 'storage/innobase/ut/ut0dbg.c'
--- a/storage/innobase/ut/ut0dbg.c	revid:jimmy.yang@oracle.com-20110412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/ut/ut0dbg.c	revid:marko.makela@stripped416-i98bfd2h3uwlybjz
@@ -25,7 +25,9 @@ Created 1/30/1994 Heikki Tuuri
 
 #include "univ.i"
 #include "ut0dbg.h"
-#include "ha_prototypes.h"
+#ifndef UNIV_HOTBACKUP
+# include "ha_prototypes.h"
+#endif /* !UNIV_HOTBACKUP */
 
 #if defined(__GNUC__) && (__GNUC__ > 2)
 #else
@@ -56,7 +58,7 @@ ut_dbg_assertion_failed(
 	ut_print_timestamp(stderr);
 #ifdef UNIV_HOTBACKUP
 	fprintf(stderr, "  InnoDB: Assertion failure in file %s line %lu\n",
-		innobase_basename(file), line);
+		file, line);
 #else /* UNIV_HOTBACKUP */
 	fprintf(stderr,
 		"  InnoDB: Assertion failure in thread %lu"

=== modified file 'storage/innobase/ut/ut0ut.c'
--- a/storage/innobase/ut/ut0ut.c	revid:jimmy.yang@oracle.com-20110412132746-ma35etb6imzp2tyl
+++ b/storage/innobase/ut/ut0ut.c	revid:marko.makela@stripped3083416-i98bfd2h3uwlybjz
@@ -245,16 +245,16 @@ ut_print_timestamp(
 		(int)cal_tm.wMinute,
 		(int)cal_tm.wSecond);
 #else
-	struct tm  cal_tm;
 	struct tm* cal_tm_ptr;
 	time_t	   tm;
 
-	time(&tm);
-
 #ifdef HAVE_LOCALTIME_R
+	struct tm  cal_tm;
+	time(&tm);
 	localtime_r(&tm, &cal_tm);
 	cal_tm_ptr = &cal_tm;
 #else
+	time(&tm);
 	cal_tm_ptr = localtime(&tm);
 #endif
 	fprintf(file,"%02d%02d%02d %2d:%02d:%02d",
@@ -288,16 +288,16 @@ ut_sprintf_timestamp(
 		(int)cal_tm.wMinute,
 		(int)cal_tm.wSecond);
 #else
-	struct tm  cal_tm;
 	struct tm* cal_tm_ptr;
 	time_t	   tm;
 
-	time(&tm);
-
 #ifdef HAVE_LOCALTIME_R
+	struct tm  cal_tm;
+	time(&tm);
 	localtime_r(&tm, &cal_tm);
 	cal_tm_ptr = &cal_tm;
 #else
+	time(&tm);
 	cal_tm_ptr = localtime(&tm);
 #endif
 	sprintf(buf, "%02d%02d%02d %2d:%02d:%02d",
@@ -333,16 +333,16 @@ ut_sprintf_timestamp_without_extra_chars
 		(int)cal_tm.wMinute,
 		(int)cal_tm.wSecond);
 #else
-	struct tm  cal_tm;
 	struct tm* cal_tm_ptr;
 	time_t	   tm;
 
-	time(&tm);
-
 #ifdef HAVE_LOCALTIME_R
+	struct tm  cal_tm;
+	time(&tm);
 	localtime_r(&tm, &cal_tm);
 	cal_tm_ptr = &cal_tm;
 #else
+	time(&tm);
 	cal_tm_ptr = localtime(&tm);
 #endif
 	sprintf(buf, "%02d%02d%02d_%2d_%02d_%02d",
@@ -374,16 +374,16 @@ ut_get_year_month_day(
 	*month = (ulint)cal_tm.wMonth;
 	*day = (ulint)cal_tm.wDay;
 #else
-	struct tm  cal_tm;
 	struct tm* cal_tm_ptr;
 	time_t	   tm;
 
-	time(&tm);
-
 #ifdef HAVE_LOCALTIME_R
+	struct tm  cal_tm;
+	time(&tm);
 	localtime_r(&tm, &cal_tm);
 	cal_tm_ptr = &cal_tm;
 #else
+	time(&tm);
 	cal_tm_ptr = localtime(&tm);
 #endif
 	*year = (ulint)cal_tm_ptr->tm_year + 1900;

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz.bundle
Thread
bzr push into mysql-trunk-innodb branch (marko.makela:3577 to 3580) marko.makela13 Apr