summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-17 11:59:23 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-17 12:02:22 +0300
commitad4b70562bb94dd063eebde5189c6e730d3120a2 (patch)
tree627420687c505983329246ab95701703186d3438 /storage
parent7198c6ab2dc8f8286f6732824ab985a76ebaaddc (diff)
downloadmariadb-git-ad4b70562bb94dd063eebde5189c6e730d3120a2.tar.gz
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.
Diffstat (limited to 'storage')
-rw-r--r--storage/maria/ma_pagecrc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/maria/ma_pagecrc.c b/storage/maria/ma_pagecrc.c
index b0c02e60929..4d73ced3b11 100644
--- a/storage/maria/ma_pagecrc.c
+++ b/storage/maria/ma_pagecrc.c
@@ -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,