Details
Description
File storage/maria/ma_check.c in 10.0.1 tarball has very suspicious code on line 4028:
my_off_t skr= (share->state.state.data_file_length +
|
(sort_info.org_data_file_type == COMPRESSED_RECORD) ?
|
MEMMAP_EXTRA_MARGIN : 0);
|
It looks like the intention was to add to data_file_length either MEMMAP_EXTRA_MARGIN or 0. But according to C operator precedence '+' has a priority over '?:', so the result of the whole expression will be either 0 or something non-zero.
I don't know how to hit this code in a test case, so I can't prove my theory. So could you please check what's the real intention here?
I saw another instance of similar code at line 4548 at the same file. So if this one has bug then the one on line 4548 has it too I guess.