Commit 3979344d authored by marko's avatar marko

branches/zip: buf_flush_buffered_writes(): Replace four occurrences of

mach_read_from_4(...) != mach_read_from_4(...) with memcmp(..., ..., 4).
parent 93ea672a
......@@ -257,9 +257,9 @@ buf_flush_buffered_writes(void)
/* TODO: page_zip */
if (mach_read_from_4(block->frame + FIL_PAGE_LSN + 4)
!= mach_read_from_4(block->frame + UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
if (UNIV_UNLIKELY(memcmp(block->frame + (FIL_PAGE_LSN + 4),
block->frame + (UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n"
......@@ -311,9 +311,9 @@ buf_flush_buffered_writes(void)
/* TODO: page_zip */
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len; len2 += UNIV_PAGE_SIZE) {
if (mach_read_from_4(write_buf + len2 + FIL_PAGE_LSN + 4)
!= mach_read_from_4(write_buf + len2 + UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
if (UNIV_UNLIKELY(memcmp(write_buf + len2 + (FIL_PAGE_LSN + 4),
write_buf + len2 + (UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n"
......@@ -337,11 +337,12 @@ buf_flush_buffered_writes(void)
/* TODO: page_zip */
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len;
len2 += UNIV_PAGE_SIZE) {
if (mach_read_from_4(write_buf + len2
+ FIL_PAGE_LSN + 4)
!= mach_read_from_4(write_buf + len2
+ UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
if (UNIV_UNLIKELY(memcmp(write_buf + len2
+ (FIL_PAGE_LSN + 4),
write_buf + len2
+ (UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4),
4))) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n"
......@@ -361,9 +362,9 @@ buf_flush_buffered_writes(void)
for (i = 0; i < trx_doublewrite->first_free; i++) {
block = trx_doublewrite->buf_block_arr[i];
/* TODO: page_zip */
if (mach_read_from_4(block->frame + FIL_PAGE_LSN + 4)
!= mach_read_from_4(block->frame + UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
if (UNIV_UNLIKELY(memcmp(block->frame + (FIL_PAGE_LSN + 4),
block->frame + (UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n"
......
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