mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Use MEM_CHECK_DEFINED to check if blocks contain uninitialized data
Fixed failure in tests when running optimized code - Some assert() was using code that had to be executed Fixed copying of some uninitialized data (fixed valgrind warning)
This commit is contained in:
parent
e3868ee072
commit
05ed9fec03
4 changed files with 6 additions and 11 deletions
storage/maria
|
@ -219,13 +219,8 @@ my_bool _ma_write_keypage(MARIA_PAGE *page, enum pagecache_page_lock lock,
|
|||
/* Verify that keynr is correct */
|
||||
DBUG_ASSERT(_ma_get_keynr(share, buff) == page->keyinfo->key_nr);
|
||||
|
||||
#if defined(EXTRA_DEBUG) && defined(HAVE_valgrind) && defined(NOT_ANYMORE)
|
||||
{
|
||||
/* This is here to catch uninitialized bytes */
|
||||
uint length= page->size;
|
||||
ulong crc= my_checksum(0, buff, length);
|
||||
int4store(buff + block_size - KEYPAGE_CHECKSUM_SIZE, crc);
|
||||
}
|
||||
#if defined(EXTRA_DEBUG) && defined(HAVE_valgrind) && defined(WHEN_DEBUGGING)
|
||||
MEM_CHECK_DEFINED(buff, block_size);
|
||||
#endif
|
||||
|
||||
page_cleanup(share, page);
|
||||
|
|
|
@ -309,7 +309,7 @@ static int run_test(const char *filename)
|
|||
}
|
||||
|
||||
/* Read through all rows and update them */
|
||||
assert(maria_scan_init(file) == 0);
|
||||
maria_scan_init(file);
|
||||
|
||||
found=0;
|
||||
while ((error= maria_scan(file,read_record)) == 0)
|
||||
|
|
|
@ -665,7 +665,7 @@ int main(int argc, char *argv[])
|
|||
if (!silent)
|
||||
puts("- Test if: Read rrnd - same");
|
||||
DBUG_PRINT("progpos",("Read rrnd - same"));
|
||||
assert(maria_scan_init(file) == 0);
|
||||
maria_scan_init(file);
|
||||
for (i=0 ; i < write_count ; i++)
|
||||
{
|
||||
int tmp;
|
||||
|
@ -818,7 +818,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
ant=0;
|
||||
assert(maria_scan_init(file) == 0);
|
||||
maria_scan_init(file);
|
||||
while ((error= maria_scan(file,record)) != HA_ERR_END_OF_FILE &&
|
||||
ant < write_count + 10)
|
||||
ant+= error ? 0 : 1;
|
||||
|
|
|
@ -1319,7 +1319,7 @@ static int _ma_balance_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
|
|||
pos= right_page->buff + share->keypage_header + length;
|
||||
memcpy(father_key_pos, pos, (size_t) k_length);
|
||||
bmove(right_page->buff + share->keypage_header,
|
||||
pos + k_length, new_right_length);
|
||||
pos + k_length, new_right_length - share->keypage_header);
|
||||
|
||||
if (share->now_transactional)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue