Commit ad4b7056 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix GCC 10 -Woverflow

maria_page_crc_check_index(): Do not attempt to convert
HA_ERR_WRONG_CRC (176) to my_bool (char).
On platforms where char is signed, the 176 will be converted to -80.

It turns out that the callers only care whether the result is zero.
Let us return 1 in this case, like we do in all other error cases.
parent 7198c6ab
......@@ -251,7 +251,8 @@ my_bool maria_page_crc_check_index(int res, PAGECACHE_IO_HOOK_ARGS *args)
if (length > share->block_size - CRC_SIZE)
{
DBUG_PRINT("error", ("Wrong page length: %u", length));
return (my_errno= HA_ERR_WRONG_CRC);
my_errno= HA_ERR_WRONG_CRC;
return 1;
}
return maria_page_crc_check(page, (uint32) page_no, share,
MARIA_NO_CRC_NORMAL_PAGE,
......
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