List:Commits« Previous MessageNext Message »
From:marko.makela Date:December 28 2011 10:43am
Subject:bzr push into mysql-trunk branch (marko.makela:3692 to 3693)
View as plain text  
 3693 Marko Mäkelä	2011-12-28 [merge]
      Merge mysql-5.5 to mysql-trunk.

    modified:
      storage/innobase/buf/buf0buf.cc
      storage/innobase/include/mem0mem.ic
      storage/innobase/include/univ.i
      storage/innobase/include/ut0mem.h
      storage/innobase/mem/mem0pool.cc
      storage/innobase/os/os0proc.cc
      storage/innobase/ut/ut0mem.cc
 3692 Annamalai Gurusami	2011-12-28
      Bug #13255225: THE VALUE OF INNODB_UNDO_LOGS IN MY.CNF IS IGNORED
      
      Introduced a new read only status variable srv_available_undo_logs.  
      During startup, this variable will be set to the total available 
      number of rollback segments.  Users can access this variable to find
      out the available number of rollback segments.  The innodb_undo_logs
      will contain the number of active rollback segments. 
      
      Review Board link:
      http://bur03.no.oracle.com/rb/r/862/

    modified:
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/srv0srv.h
      storage/innobase/srv/srv0srv.cc
      storage/innobase/srv/srv0start.cc
=== modified file 'storage/innobase/buf/buf0buf.cc'
--- a/storage/innobase/buf/buf0buf.cc	revid:annamalai.gurusami@stripped
+++ b/storage/innobase/buf/buf0buf.cc	revid:marko.makela@oracle.com-20111228104055-7htlfpzlez6tdys3
@@ -1041,11 +1041,8 @@ buf_chunk_init(
 	for (i = chunk->size; i--; ) {
 
 		buf_block_init(buf_pool, block, frame);
+		UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
 
-#ifdef HAVE_purify
-		/* Wipe contents of frame to eliminate a Purify warning */
-		memset(block->frame, '\0', UNIV_PAGE_SIZE);
-#endif
 		/* Add the block to the free list */
 		UT_LIST_ADD_LAST(list, buf_pool->free, (&block->page));
 

=== modified file 'storage/innobase/include/mem0mem.ic'
--- a/storage/innobase/include/mem0mem.ic	revid:annamalai.gurusami@oracle.com-20111228083708-xg77doxtvsura8t9
+++ b/storage/innobase/include/mem0mem.ic	revid:marko.makela@stripped0111228104055-7htlfpzlez6tdys3
@@ -209,10 +209,6 @@ mem_heap_alloc(
 	buf = (byte*) buf + MEM_FIELD_HEADER_SIZE;
 
 #endif
-#ifdef UNIV_SET_MEM_TO_ZERO
-	UNIV_MEM_ALLOC(buf, n);
-	memset(buf, '\0', n);
-#endif
 	UNIV_MEM_ALLOC(buf, n);
 	return(buf);
 }

=== modified file 'storage/innobase/include/univ.i'
--- a/storage/innobase/include/univ.i	revid:annamalai.gurusami@stripped7doxtvsura8t9
+++ b/storage/innobase/include/univ.i	revid:marko.makela@stripped
@@ -161,14 +161,6 @@ be excluded from instrumentation. */
 /*			DEBUG VERSION CONTROL
 			===================== */
 
-/* The following flag will make InnoDB to initialize
-all memory it allocates to zero. It hides Purify
-warnings about reading unallocated memory unless
-memory is read outside the allocated blocks. */
-/*
-#define UNIV_INIT_MEM_TO_ZERO
-*/
-
 /* When this macro is defined then additional test functions will be
 compiled. These functions live at the end of each relevant source file
 and have "test_" prefix. These functions are not called from anywhere in
@@ -244,15 +236,6 @@ operations (very slow); also UNIV_DEBUG
 #define UNIV_BTR_DEBUG				/* check B-tree links */
 #define UNIV_LIGHT_MEM_DEBUG			/* light memory debugging */
 
-#ifdef HAVE_purify
-/* The following sets all new allocated memory to zero before use:
-this can be used to eliminate unnecessary Purify warnings, but note that
-it also masks many bugs Purify could detect. For detailed Purify analysis it
-is best to remove the define below and look through the warnings one
-by one. */
-#define UNIV_SET_MEM_TO_ZERO
-#endif
-
 /*
 #define UNIV_SQL_DEBUG
 #define UNIV_LOG_DEBUG

=== modified file 'storage/innobase/include/ut0mem.h'
--- a/storage/innobase/include/ut0mem.h	revid:annamalai.gurusami@stripped8-xg77doxtvsura8t9
+++ b/storage/innobase/include/ut0mem.h	revid:marko.makela@stripped6tdys3
@@ -78,40 +78,19 @@ ut_mem_init(void);
 /*=============*/
 
 /**********************************************************************//**
-Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
-defined and set_to_zero is TRUE.
+Allocates memory.
 @return	own: allocated memory */
 UNIV_INTERN
 void*
 ut_malloc_low(
 /*==========*/
 	ulint	n,			/*!< in: number of bytes to allocate */
-	ibool	set_to_zero,		/*!< in: TRUE if allocated memory
-					should be set to zero if
-					UNIV_SET_MEM_TO_ZERO is defined */
-	ibool	assert_on_error);	/*!< in: if TRUE, we crash mysqld if
+	ibool	assert_on_error)	/*!< in: if TRUE, we crash mysqld if
 					the memory cannot be allocated */
+	__attribute__((malloc));
 /**********************************************************************//**
-Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
-defined.
-@return	own: allocated memory */
-UNIV_INTERN
-void*
-ut_malloc(
-/*======*/
-	ulint	n);	/*!< in: number of bytes to allocate */
-#ifndef UNIV_HOTBACKUP
-/**********************************************************************//**
-Tests if malloc of n bytes would succeed. ut_malloc() asserts if memory runs
-out. It cannot be used if we want to return an error message. Prints to
-stderr a message if fails.
-@return	TRUE if succeeded */
-UNIV_INTERN
-ibool
-ut_test_malloc(
-/*===========*/
-	ulint	n);	/*!< in: try to allocate this many bytes */
-#endif /* !UNIV_HOTBACKUP */
+Allocates memory. */
+#define ut_malloc(n) ut_malloc_low(n, TRUE)
 /**********************************************************************//**
 Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
 a nop. */

=== modified file 'storage/innobase/mem/mem0pool.cc'
--- a/storage/innobase/mem/mem0pool.cc	revid:annamalai.gurusami@stripped83708-xg77doxtvsura8t9
+++ b/storage/innobase/mem/mem0pool.cc	revid:marko.makela@strippedlez6tdys3
@@ -228,11 +228,7 @@ mem_pool_create(
 
 	pool = static_cast<mem_pool_t*>(ut_malloc(sizeof(mem_pool_t)));
 
-	/* We do not set the memory to zero (FALSE) in the pool,
-	but only when allocated at a higher level in mem0mem.cc.
-	This is to avoid masking useful Purify warnings. */
-
-	pool->buf = static_cast<byte*>(ut_malloc_low(size, FALSE, TRUE));
+	pool->buf = static_cast<byte*>(ut_malloc_low(size, TRUE));
 	pool->size = size;
 
 	mutex_create(mem_pool_mutex_key, &pool->mutex, SYNC_MEM_POOL);

=== modified file 'storage/innobase/os/os0proc.cc'
--- a/storage/innobase/os/os0proc.cc	revid:annamalai.gurusami@oracle.com-20111228083708-xg77doxtvsura8t9
+++ b/storage/innobase/os/os0proc.cc	revid:marko.makela@stripped104055-7htlfpzlez6tdys3
@@ -111,9 +111,6 @@ os_mem_alloc_large(
 		os_fast_mutex_lock(&ut_list_mutex);
 		ut_total_allocated_memory += size;
 		os_fast_mutex_unlock(&ut_list_mutex);
-# ifdef UNIV_SET_MEM_TO_ZERO
-		memset(ptr, '\0', size);
-# endif
 		UNIV_MEM_ALLOC(ptr, size);
 		return(ptr);
 	}

=== modified file 'storage/innobase/ut/ut0mem.cc'
--- a/storage/innobase/ut/ut0mem.cc	revid:annamalai.gurusami@stripped
+++ b/storage/innobase/ut/ut0mem.cc	revid:marko.makela@oracle.com-20111228104055-7htlfpzlez6tdys3
@@ -89,17 +89,13 @@ ut_mem_init(void)
 #endif /* !UNIV_HOTBACKUP */
 
 /**********************************************************************//**
-Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
-defined and set_to_zero is TRUE.
+Allocates memory.
 @return	own: allocated memory */
 UNIV_INTERN
 void*
 ut_malloc_low(
 /*==========*/
 	ulint	n,		/*!< in: number of bytes to allocate */
-	ibool	set_to_zero,	/*!< in: TRUE if allocated memory should be
-				set to zero if UNIV_SET_MEM_TO_ZERO is
-				defined */
 	ibool	assert_on_error)/*!< in: if TRUE, we crash mysqld if the
 				memory cannot be allocated */
 {
@@ -111,12 +107,6 @@ ut_malloc_low(
 		ret = malloc(n);
 		ut_a(ret || !assert_on_error);
 
-#ifdef UNIV_SET_MEM_TO_ZERO
-		if (set_to_zero) {
-			memset(ret, '\0', n);
-			UNIV_MEM_ALLOC(ret, n);
-		}
-#endif
 		return(ret);
 	}
 
@@ -198,12 +188,6 @@ retry:
 		}
 	}
 
-	if (set_to_zero) {
-#ifdef UNIV_SET_MEM_TO_ZERO
-		memset(ret, '\0', n + sizeof(ut_mem_block_t));
-#endif
-	}
-
 	UNIV_MEM_ALLOC(ret, n + sizeof(ut_mem_block_t));
 
 	((ut_mem_block_t*) ret)->size = n + sizeof(ut_mem_block_t);
@@ -220,76 +204,11 @@ retry:
 	void*	ret = malloc(n);
 	ut_a(ret || !assert_on_error);
 
-# ifdef UNIV_SET_MEM_TO_ZERO
-	if (set_to_zero) {
-		memset(ret, '\0', n);
-		UNIV_MEM_ALLOC(ret, n);
-	}
-# endif
 	return(ret);
 #endif /* !UNIV_HOTBACKUP */
 }
 
 /**********************************************************************//**
-Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
-defined.
-@return	own: allocated memory */
-UNIV_INTERN
-void*
-ut_malloc(
-/*======*/
-	ulint	n)	/*!< in: number of bytes to allocate */
-{
-#ifndef UNIV_HOTBACKUP
-	return(ut_malloc_low(n, TRUE, TRUE));
-#else /* !UNIV_HOTBACKUP */
-	return(malloc(n));
-#endif /* !UNIV_HOTBACKUP */
-}
-
-#ifndef UNIV_HOTBACKUP
-/**********************************************************************//**
-Tests if malloc of n bytes would succeed. ut_malloc() asserts if memory runs
-out. It cannot be used if we want to return an error message. Prints to
-stderr a message if fails.
-@return	TRUE if succeeded */
-UNIV_INTERN
-ibool
-ut_test_malloc(
-/*===========*/
-	ulint	n)	/*!< in: try to allocate this many bytes */
-{
-	void*	ret;
-
-	ret = malloc(n);
-
-	if (ret == NULL) {
-		ut_print_timestamp(stderr);
-		fprintf(stderr,
-			"  InnoDB: Error: cannot allocate"
-			" %lu bytes of memory for\n"
-			"InnoDB: a BLOB with malloc! Total allocated memory\n"
-			"InnoDB: by InnoDB %lu bytes."
-			" Operating system errno: %d\n"
-			"InnoDB: Check if you should increase"
-			" the swap file or\n"
-			"InnoDB: ulimits of your operating system.\n"
-			"InnoDB: On FreeBSD check you have"
-			" compiled the OS with\n"
-			"InnoDB: a big enough maximum process size.\n",
-			(ulong) n,
-			(ulong) ut_total_allocated_memory,
-			(int) errno);
-		return(FALSE);
-	}
-
-	free(ret);
-
-	return(TRUE);
-}
-#endif /* !UNIV_HOTBACKUP */
-
-/**********************************************************************//**
 Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
 a nop. */
 UNIV_INTERN

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (marko.makela:3692 to 3693) marko.makela29 Dec