@@ -665,7 +665,7 @@ struct FetchIndexRootPages : public AbstractCallback {
665
665
@param block Block to use for IO
666
666
@retval DB_SUCCESS or error code */
667
667
dberr_t run (const fil_iterator_t & iter,
668
- buf_block_t * block) UNIV_NOTHROW;
668
+ buf_block_t * block) UNIV_NOTHROW override ;
669
669
670
670
/* * Called for each block as it is read from the file.
671
671
@param block block to convert, it is not from the buffer pool.
@@ -839,7 +839,8 @@ class PageConverter : public AbstractCallback {
839
839
}
840
840
}
841
841
842
- dberr_t run (const fil_iterator_t & iter, buf_block_t * block) UNIV_NOTHROW
842
+ dberr_t run (const fil_iterator_t & iter,
843
+ buf_block_t * block) UNIV_NOTHROW override
843
844
{
844
845
return fil_iterate (iter, block, *this );
845
846
}
@@ -3448,6 +3449,8 @@ dberr_t FetchIndexRootPages::run(const fil_iterator_t& iter,
3448
3449
#endif
3449
3450
srv_page_size;
3450
3451
byte* page_compress_buf = static_cast <byte*>(malloc (buf_size));
3452
+ const bool full_crc32 = fil_space_t::full_crc32 (m_space_flags);
3453
+ bool skip_checksum_check = false ;
3451
3454
ut_ad (!srv_read_only_mode);
3452
3455
3453
3456
if (!page_compress_buf)
@@ -3486,15 +3489,18 @@ dberr_t FetchIndexRootPages::run(const fil_iterator_t& iter,
3486
3489
goto func_exit;
3487
3490
}
3488
3491
3489
- page_compressed= fil_page_is_compressed_encrypted (readptr) ||
3490
- fil_page_is_compressed (readptr);
3492
+ page_compressed=
3493
+ (full_crc32 && fil_space_t::is_compressed (m_space_flags) &&
3494
+ buf_page_is_compressed (readptr, m_space_flags)) ||
3495
+ (fil_page_is_compressed_encrypted (readptr) ||
3496
+ fil_page_is_compressed (readptr));
3491
3497
3492
3498
if (page_compressed && block->page .zip .data )
3493
3499
goto page_corrupted;
3494
3500
3495
3501
if (encrypted)
3496
3502
{
3497
- if (!fil_space_verify_crypt_checksum (readptr, zip_size ))
3503
+ if (!buf_page_verify_crypt_checksum (readptr, m_space_flags ))
3498
3504
goto page_corrupted;
3499
3505
3500
3506
if (!fil_space_decrypt (get_space_id (), iter.crypt_data , readptr,
@@ -3503,15 +3509,21 @@ dberr_t FetchIndexRootPages::run(const fil_iterator_t& iter,
3503
3509
goto func_exit;
3504
3510
}
3505
3511
3512
+ /* For full_crc32 format, skip checksum check
3513
+ after decryption. */
3514
+ skip_checksum_check= full_crc32 && encrypted;
3515
+
3506
3516
if (page_compressed)
3507
3517
{
3508
- ulint compress_length= fil_page_decompress (page_compress_buf, readptr,
3518
+ ulint compress_length= fil_page_decompress (page_compress_buf,
3519
+ readptr,
3509
3520
m_space_flags);
3510
3521
ut_ad (compress_length != srv_page_size);
3511
3522
if (compress_length == 0 )
3512
3523
goto page_corrupted;
3513
3524
}
3514
- else if (buf_page_is_corrupted (false , readptr, m_space_flags))
3525
+ else if (!skip_checksum_check
3526
+ && buf_page_is_corrupted (false , readptr, m_space_flags))
3515
3527
goto page_corrupted;
3516
3528
3517
3529
err= this ->operator ()(block);
0 commit comments