Bug #61417 buf_block_is_uncompressed() seems wrong
Submitted: 6 Jun 2011 6:47 Modified: 6 Jun 2011 6:51
Reporter: Yasufumi Kinoshita Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S2 (Serious)
Version:5.5, 5.1 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[6 Jun 2011 6:47] Yasufumi Kinoshita
Description:
In buf0buf.c, the head of buf_block_is_uncompressed(),

        if (UNIV_UNLIKELY((((ulint) block) % sizeof *block) != 0)) {
                /* The pointer should be aligned. */
                return(FALSE);
        }

But I think the result is almost FALSE always.
Because I added the assertion

"
/* if not pass, buf_block_is_uncompressed() works incorrectly. */
ut_a((((ulint) chunk->blocks) % sizeof(buf_block_t)) == 0);
"
just after
"chunk->blocks = chunk->mem;"
at buf_chunk_init()

And, InnoDB-Plugin never startup.

How to repeat:
Just as described above.

Suggested fix:
Fix buf_block_is_uncompressed()

or

Add the assertion and fix chunk->blocks alignment at allocation
[6 Jun 2011 6:51] Valeriy Kravchuk
Thank you for the problem report.