Commit 84745ca4 authored by Vasil Dimov's avatar Vasil Dimov

Merge from mysql-5.1-innodb:

  ------------------------------------------------------------
  revno: 3439
  revision-id: marko.makela@oracle.com-20100504124744-c1ivf5tm90nv7lc1
  parent: marko.makela@oracle.com-20100504105546-4ew7a77e9uhxmhho
  committer: Marko M?kel? <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Tue 2010-05-04 15:47:44 +0300
  message:
    Add Valgrind checks to catch uninitialized writes to data files.
    buf_flush_insert_into_flush_list(),
    buf_flush_insert_sorted_into_flush_list(),
    buf_flush_post_to_doublewrite_buf(): Check that the page is initialized.
  modified:
    storage/innodb_plugin/buf/buf0flu.c 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Fbuf%2Fbuf0flu.c
  ------------------------------------------------------------
parent 33c4a298
......@@ -271,6 +271,17 @@ buf_flush_insert_into_flush_list(
block->page.oldest_modification = lsn;
UT_LIST_ADD_FIRST(list, buf_pool->flush_list, &block->page);
#ifdef UNIV_DEBUG_VALGRIND
{
ulint zip_size = buf_block_get_zip_size(block);
if (UNIV_UNLIKELY(zip_size)) {
UNIV_MEM_ASSERT_RW(block->page.zip.data, zip_size);
} else {
UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE);
}
}
#endif /* UNIV_DEBUG_VALGRIND */
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(buf_flush_validate_low(buf_pool));
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
......@@ -320,6 +331,18 @@ buf_flush_insert_sorted_into_flush_list(
ut_d(block->page.in_flush_list = TRUE);
block->page.oldest_modification = lsn;
#ifdef UNIV_DEBUG_VALGRIND
{
ulint zip_size = buf_block_get_zip_size(block);
if (UNIV_UNLIKELY(zip_size)) {
UNIV_MEM_ASSERT_RW(block->page.zip.data, zip_size);
} else {
UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE);
}
}
#endif /* UNIV_DEBUG_VALGRIND */
prev_b = NULL;
/* For the most part when this function is called the flush_rbt
......@@ -890,6 +913,7 @@ buf_flush_post_to_doublewrite_buf(
zip_size = buf_page_get_zip_size(bpage);
if (UNIV_UNLIKELY(zip_size)) {
UNIV_MEM_ASSERT_RW(bpage->zip.data, zip_size);
/* Copy the compressed page and clear the rest. */
memcpy(trx_doublewrite->write_buf
+ UNIV_PAGE_SIZE * trx_doublewrite->first_free,
......@@ -899,6 +923,8 @@ buf_flush_post_to_doublewrite_buf(
+ zip_size, 0, UNIV_PAGE_SIZE - zip_size);
} else {
ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE);
UNIV_MEM_ASSERT_RW(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
memcpy(trx_doublewrite->write_buf
+ UNIV_PAGE_SIZE * trx_doublewrite->first_free,
......
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