Commit 3d9183da authored by marko's avatar marko

branches/zip: Correct the Valgrind instrumentation that was added in r1947.

parent 8e4c946d
...@@ -921,17 +921,23 @@ page_cur_insert_rec_low( ...@@ -921,17 +921,23 @@ page_cur_insert_rec_low(
/* 1. Get the size of the physical record in the page */ /* 1. Get the size of the physical record in the page */
rec_size = rec_offs_size(offsets); rec_size = rec_offs_size(offsets);
/* The whole record must be writeable. */ #ifdef UNIV_DEBUG_VALGRIND
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets)); {
/* All data bytes of the record must be valid. */ const void* rec_start
UNIV_MEM_ASSERT_W(rec_get_start(rec, offsets), rec_size); = rec - rec_offs_extra_size(offsets);
/* The variable-length header must be valid. */ ulint extra_size
UNIV_MEM_ASSERT_RW(rec_get_start(rec, offsets), = rec_offs_extra_size(offsets)
rec_offs_extra_size(offsets) - (rec_offs_comp(offsets)
- rec_offs_comp(offsets)
? REC_N_NEW_EXTRA_BYTES ? REC_N_NEW_EXTRA_BYTES
: REC_N_OLD_EXTRA_BYTES); : REC_N_OLD_EXTRA_BYTES);
/* All data bytes of the record must be valid. */
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
/* The variable-length header must be valid. */
UNIV_MEM_ASSERT_RW(rec_start, extra_size);
}
#endif /* UNIV_DEBUG_VALGRIND */
/* 2. Try to find suitable space from page memory management */ /* 2. Try to find suitable space from page memory management */
free_rec = page_header_get_ptr(page, PAGE_FREE); free_rec = page_header_get_ptr(page, PAGE_FREE);
...@@ -1187,17 +1193,23 @@ page_cur_insert_rec_zip( ...@@ -1187,17 +1193,23 @@ page_cur_insert_rec_zip(
/* 1. Get the size of the physical record in the page */ /* 1. Get the size of the physical record in the page */
rec_size = rec_offs_size(offsets); rec_size = rec_offs_size(offsets);
/* The whole record must be writeable. */ #ifdef UNIV_DEBUG_VALGRIND
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets)); {
/* All data bytes of the record must be valid. */ const void* rec_start
UNIV_MEM_ASSERT_W(rec_get_start(rec, offsets), rec_size); = rec - rec_offs_extra_size(offsets);
/* The variable-length header must be valid. */ ulint extra_size
UNIV_MEM_ASSERT_RW(rec_get_start(rec, offsets), = rec_offs_extra_size(offsets)
rec_offs_extra_size(offsets) - (rec_offs_comp(offsets)
- rec_offs_comp(offsets)
? REC_N_NEW_EXTRA_BYTES ? REC_N_NEW_EXTRA_BYTES
: REC_N_OLD_EXTRA_BYTES); : REC_N_OLD_EXTRA_BYTES);
/* All data bytes of the record must be valid. */
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
/* The variable-length header must be valid. */
UNIV_MEM_ASSERT_RW(rec_start, extra_size);
}
#endif /* UNIV_DEBUG_VALGRIND */
/* 2. Try to find suitable space from page memory management */ /* 2. Try to find suitable space from page memory management */
if (!page_zip_available(page_zip, dict_index_is_clust(index), if (!page_zip_available(page_zip, dict_index_is_clust(index),
rec_size, 1)) { rec_size, 1)) {
......
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