3473 Marko Mäkelä 2010-05-19
Make UNIV_DEBUG Valgrind friendly in the built-in InnoDB.
Use | instead of +, and mask out the dont-care bits in debug assertions.
modified:
storage/innobase/include/mach0data.ic
3472 Marko Mäkelä 2010-05-19
Make UNIV_DEBUG Valgrind friendly. Use | instead of +,
and mask out the dont-care bits in debug assertions.
modified:
storage/innodb_plugin/include/mach0data.ic
3471 Marko Mäkelä 2010-05-19
Silence some more bogus Valgrind warnings on non-32-bit systems. (Bug #53307)
modified:
storage/innodb_plugin/buf/buf0buddy.c
storage/innodb_plugin/buf/buf0buf.c
storage/innodb_plugin/buf/buf0lru.c
storage/innodb_plugin/page/page0zip.c
3470 Marko Mäkelä 2010-05-19
Add Valgrind checks to compressed BLOB access.
modified:
storage/innodb_plugin/btr/btr0cur.c
3469 Marko Mäkelä 2010-05-19
Work around Bug #53750 in innodb.innodb_bug48024
modified:
mysql-test/suite/innodb/t/innodb_bug48024.test
3468 Marko Mäkelä 2010-05-18
Work around Bug #53750 in innodb_bug48024.test
modified:
mysql-test/suite/innodb_plugin/t/innodb_bug48024.test
=== modified file 'mysql-test/suite/innodb/t/innodb_bug48024.test'
--- a/mysql-test/suite/innodb/t/innodb_bug48024.test revid:marko.makela@stripped130658-rd00ql7h02ooakh1
+++ b/mysql-test/suite/innodb/t/innodb_bug48024.test revid:marko.makela@stripped9081618-h38q02qxuvcowbtk
@@ -10,6 +10,8 @@ ADD CONSTRAINT FOREIGN KEY(b) REFERENCES
DROP TABLE bug48024,bug48024_b;
+# Work around Bug #53750 (failure in mysql-test-run --ps-protocol)
+-- disable_ps_protocol
delimiter |;
CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB;
CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB;
=== modified file 'storage/innobase/include/mach0data.ic'
--- a/storage/innobase/include/mach0data.ic revid:marko.makela@strippedrd00ql7h02ooakh1
+++ b/storage/innobase/include/mach0data.ic revid:marko.makela@strippeduvcowbtk
@@ -19,7 +19,7 @@ mach_write_to_1(
ulint n) /* in: ulint integer to be stored, >= 0, < 256 */
{
ut_ad(b);
- ut_ad(n <= 0xFFUL);
+ ut_ad((n | 0xFFUL) <= 0xFFUL);
b[0] = (byte)n;
}
@@ -48,7 +48,7 @@ mach_write_to_2(
ulint n) /* in: ulint integer to be stored */
{
ut_ad(b);
- ut_ad(n <= 0xFFFFUL);
+ ut_ad((n | 0xFFFFUL) <= 0xFFFFUL);
b[0] = (byte)(n >> 8);
b[1] = (byte)(n);
@@ -64,10 +64,7 @@ mach_read_from_2(
/* out: ulint integer */
byte* b) /* in: pointer to 2 bytes */
{
- ut_ad(b);
- return( ((ulint)(b[0]) << 8)
- + (ulint)(b[1])
- );
+ return(((ulint)(b[0]) << 8) | (ulint)(b[1]));
}
/************************************************************
@@ -112,7 +109,7 @@ mach_write_to_3(
ulint n) /* in: ulint integer to be stored */
{
ut_ad(b);
- ut_ad(n <= 0xFFFFFFUL);
+ ut_ad((n | 0xFFFFFFUL) <= 0xFFFFFFUL);
b[0] = (byte)(n >> 16);
b[1] = (byte)(n >> 8);
@@ -131,8 +128,8 @@ mach_read_from_3(
{
ut_ad(b);
return( ((ulint)(b[0]) << 16)
- + ((ulint)(b[1]) << 8)
- + (ulint)(b[2])
+ | ((ulint)(b[1]) << 8)
+ | (ulint)(b[2])
);
}
@@ -166,9 +163,9 @@ mach_read_from_4(
{
ut_ad(b);
return( ((ulint)(b[0]) << 24)
- + ((ulint)(b[1]) << 16)
- + ((ulint)(b[2]) << 8)
- + (ulint)(b[3])
+ | ((ulint)(b[1]) << 16)
+ | ((ulint)(b[2]) << 8)
+ | (ulint)(b[3])
);
}
@@ -670,7 +667,7 @@ mach_read_from_2_little_endian(
/* out: unsigned long int */
byte* buf) /* in: from where to read */
{
- return((ulint)(*buf) + ((ulint)(*(buf + 1))) * 256);
+ return((ulint)(buf[0]) | ((ulint)(buf[1]) << 8));
}
/*************************************************************
=== modified file 'storage/innodb_plugin/btr/btr0cur.c'
--- a/storage/innodb_plugin/btr/btr0cur.c revid:marko.makela@stripped
+++ b/storage/innodb_plugin/btr/btr0cur.c revid:marko.makela@strippedom-20100519081618-h38q02qxuvcowbtk
@@ -3871,6 +3871,8 @@ btr_store_big_rec_extern_fields(
field_ref += local_len;
}
extern_len = big_rec_vec->fields[i].len;
+ UNIV_MEM_ASSERT_RW(big_rec_vec->fields[i].data,
+ extern_len);
ut_a(extern_len > 0);
@@ -4507,6 +4509,7 @@ btr_copy_blob_prefix(
mtr_commit(&mtr);
if (page_no == FIL_NULL || copy_len != part_len) {
+ UNIV_MEM_ASSERT_RW(buf, copied_len);
return(copied_len);
}
@@ -4690,6 +4693,7 @@ btr_copy_externally_stored_field_prefix_
space_id, page_no, offset);
inflateEnd(&d_stream);
mem_heap_free(heap);
+ UNIV_MEM_ASSERT_RW(buf, d_stream.total_out);
return(d_stream.total_out);
} else {
return(btr_copy_blob_prefix(buf, len, space_id,
=== modified file 'storage/innodb_plugin/buf/buf0buddy.c'
--- a/storage/innodb_plugin/buf/buf0buddy.c revid:marko.makela@strippedooakh1
+++ b/storage/innodb_plugin/buf/buf0buddy.c revid:marko.makela@stripped
@@ -495,7 +495,12 @@ success:
mutex_exit(mutex);
} else if (i == buf_buddy_get_slot(sizeof(buf_page_t))) {
/* This must be a buf_page_t object. */
+#if UNIV_WORD_SIZE == 4
+ /* On 32-bit systems, there is no padding in
+ buf_page_t. On other systems, Valgrind could complain
+ about uninitialized pad bytes. */
UNIV_MEM_ASSERT_RW(src, size);
+#endif
if (buf_buddy_relocate_block(src, dst)) {
goto success;
=== modified file 'storage/innodb_plugin/buf/buf0buf.c'
--- a/storage/innodb_plugin/buf/buf0buf.c revid:marko.makela@stripped58-rd00ql7h02ooakh1
+++ b/storage/innodb_plugin/buf/buf0buf.c revid:marko.makela@strippedxuvcowbtk
@@ -2280,7 +2280,12 @@ wait_until_unfixed:
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
mutex_enter(&block->mutex);
+#if UNIV_WORD_SIZE == 4
+ /* On 32-bit systems, there is no padding in buf_page_t. On
+ other systems, Valgrind could complain about uninitialized pad
+ bytes. */
UNIV_MEM_ASSERT_RW(&block->page, sizeof block->page);
+#endif
buf_block_buf_fix_inc(block, file, line);
=== modified file 'storage/innodb_plugin/buf/buf0lru.c'
--- a/storage/innodb_plugin/buf/buf0lru.c revid:marko.makela@strippedql7h02ooakh1
+++ b/storage/innodb_plugin/buf/buf0lru.c revid:marko.makela@strippedtk
@@ -1494,8 +1494,13 @@ alloc:
ut_ad(prev_b->in_LRU_list);
ut_ad(buf_page_in_file(prev_b));
+#if UNIV_WORD_SIZE == 4
+ /* On 32-bit systems, there is no
+ padding in buf_page_t. On other
+ systems, Valgrind could complain about
+ uninitialized pad bytes. */
UNIV_MEM_ASSERT_RW(prev_b, sizeof *prev_b);
-
+#endif
UT_LIST_INSERT_AFTER(LRU, buf_pool->LRU,
prev_b, b);
=== modified file 'storage/innodb_plugin/include/mach0data.ic'
--- a/storage/innodb_plugin/include/mach0data.ic revid:marko.makela@stripped658-rd00ql7h02ooakh1
+++ b/storage/innodb_plugin/include/mach0data.ic revid:marko.makela@stripped-h38q02qxuvcowbtk
@@ -36,7 +36,7 @@ mach_write_to_1(
ulint n) /*!< in: ulint integer to be stored, >= 0, < 256 */
{
ut_ad(b);
- ut_ad(n <= 0xFFUL);
+ ut_ad((n | 0xFFUL) <= 0xFFUL);
b[0] = (byte)n;
}
@@ -65,7 +65,7 @@ mach_write_to_2(
ulint n) /*!< in: ulint integer to be stored */
{
ut_ad(b);
- ut_ad(n <= 0xFFFFUL);
+ ut_ad((n | 0xFFFFUL) <= 0xFFFFUL);
b[0] = (byte)(n >> 8);
b[1] = (byte)(n);
@@ -81,10 +81,7 @@ mach_read_from_2(
/*=============*/
const byte* b) /*!< in: pointer to 2 bytes */
{
- ut_ad(b);
- return( ((ulint)(b[0]) << 8)
- + (ulint)(b[1])
- );
+ return(((ulint)(b[0]) << 8) | (ulint)(b[1]));
}
/********************************************************//**
@@ -129,7 +126,7 @@ mach_write_to_3(
ulint n) /*!< in: ulint integer to be stored */
{
ut_ad(b);
- ut_ad(n <= 0xFFFFFFUL);
+ ut_ad((n | 0xFFFFFFUL) <= 0xFFFFFFUL);
b[0] = (byte)(n >> 16);
b[1] = (byte)(n >> 8);
@@ -148,8 +145,8 @@ mach_read_from_3(
{
ut_ad(b);
return( ((ulint)(b[0]) << 16)
- + ((ulint)(b[1]) << 8)
- + (ulint)(b[2])
+ | ((ulint)(b[1]) << 8)
+ | (ulint)(b[2])
);
}
@@ -183,9 +180,9 @@ mach_read_from_4(
{
ut_ad(b);
return( ((ulint)(b[0]) << 24)
- + ((ulint)(b[1]) << 16)
- + ((ulint)(b[2]) << 8)
- + (ulint)(b[3])
+ | ((ulint)(b[1]) << 16)
+ | ((ulint)(b[2]) << 8)
+ | (ulint)(b[3])
);
}
@@ -721,7 +718,7 @@ mach_read_from_2_little_endian(
/*===========================*/
const byte* buf) /*!< in: from where to read */
{
- return((ulint)(*buf) + ((ulint)(*(buf + 1))) * 256);
+ return((ulint)(buf[0]) | ((ulint)(buf[1]) << 8));
}
/*********************************************************//**
=== modified file 'storage/innodb_plugin/page/page0zip.c'
--- a/storage/innodb_plugin/page/page0zip.c revid:marko.makela@strippedl7h02ooakh1
+++ b/storage/innodb_plugin/page/page0zip.c revid:marko.makela@strippedbtk
@@ -3117,8 +3117,13 @@ page_zip_validate_low(
temp_page_zip in a debugger when running valgrind --db-attach. */
VALGRIND_GET_VBITS(page, temp_page, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE);
+# if UNIV_WORD_SIZE == 4
VALGRIND_GET_VBITS(page_zip, &temp_page_zip, sizeof temp_page_zip);
+ /* On 32-bit systems, there is no padding in page_zip_des_t.
+ On other systems, Valgrind could complain about uninitialized
+ pad bytes. */
UNIV_MEM_ASSERT_RW(page_zip, sizeof *page_zip);
+# endif
VALGRIND_GET_VBITS(page_zip->data, temp_page,
page_zip_get_size(page_zip));
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20100519081618-h38q02qxuvcowbtk.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-innodb branch (marko.makela:3468 to 3473) | marko.makela | 19 May |