mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
branches/zip: Improve Valgrind instrumentation of the file-based merge sort
in fast index creation. row_merge_write_eof(), row_merge_buf_write(): When UNIV_DEBUG_VALGRIND is defined, fill the rest of the block (after the end-of-block marker) with 0xff.
This commit is contained in:
@@ -437,7 +437,7 @@ row_merge_buf_write(
|
||||
#ifdef UNIV_DEBUG_VALGRIND
|
||||
/* The rest of the block is uninitialized. Initialize it
|
||||
to avoid bogus warnings. */
|
||||
memset(b, 0, block[1] - b);
|
||||
memset(b, 0xff, block[1] - b);
|
||||
#endif /* UNIV_DEBUG_VALGRIND */
|
||||
}
|
||||
|
||||
@@ -776,7 +776,7 @@ row_merge_write_rec(
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
UNIV_MEM_ALLOC(block[0], sizeof block[0]);
|
||||
UNIV_MEM_INVALID(block[0], sizeof block[0]);
|
||||
|
||||
/* Copy the rest. */
|
||||
b = block[0];
|
||||
@@ -811,13 +811,17 @@ row_merge_write_eof(
|
||||
*b++ = 0;
|
||||
UNIV_MEM_ASSERT_RW(block[0], b - block[0]);
|
||||
UNIV_MEM_ASSERT_W(block[0], sizeof block[0]);
|
||||
UNIV_MEM_VALID(block[0], sizeof block[0]);
|
||||
#ifdef UNIV_DEBUG_VALGRIND
|
||||
/* The rest of the block is uninitialized. Initialize it
|
||||
to avoid bogus warnings. */
|
||||
memset(b, 0xff, block[1] - b);
|
||||
#endif /* UNIV_DEBUG_VALGRIND */
|
||||
|
||||
if (!row_merge_write(fd, (*foffs)++, block)) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
UNIV_MEM_ALLOC(block[0], sizeof block[0]);
|
||||
UNIV_MEM_INVALID(block[0], sizeof block[0]);
|
||||
return(block[0]);
|
||||
}
|
||||
|
||||
@@ -1024,7 +1028,7 @@ row_merge_read_clustered_index(
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
UNIV_MEM_ALLOC(block[0], sizeof block[0]);
|
||||
UNIV_MEM_INVALID(block[0], sizeof block[0]);
|
||||
merge_buf[i] = row_merge_buf_empty(buf);
|
||||
}
|
||||
|
||||
@@ -1218,7 +1222,7 @@ row_merge(
|
||||
return(DB_CORRUPTION);
|
||||
}
|
||||
|
||||
UNIV_MEM_ALLOC(block[0], sizeof block[0]);
|
||||
UNIV_MEM_INVALID(block[0], sizeof block[0]);
|
||||
}
|
||||
|
||||
/* Swap file descriptors for the next pass. */
|
||||
|
||||
Reference in New Issue
Block a user