51 bool use_legacy_big_endian =
false);
115 uint32_t checksum_field2
117 uint32_t
crc32 [[maybe_unused]],
119 [[maybe_unused]])
const {}
126 uint32_t checksum_field2
127 [[maybe_unused]])
const {}
135 uint32_t checksum_field2
138 [[maybe_unused]])
const {}
147 uint32_t old_checksum [[maybe_unused]],
148 uint32_t new_checksum [[maybe_unused]],
149 uint32_t checksum_field1 [[maybe_unused]],
150 uint32_t checksum_field2 [[maybe_unused]],
162 uint32_t checksum_field2
163 [[maybe_unused]])
const {}
176 [[maybe_unused]])
const {}
200 [[nodiscard]]
static bool is_lsn_valid(
const byte *frame,
201 uint32_t page_size)
noexcept;
210 uint32_t checksum_field2,
219 uint32_t checksum_field2,
229 uint32_t checksum_field2,
231 bool use_legacy_big_endian)
const;
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:48
uint32_t page_no_t
Page number.
Definition: api0api.h:46
ulong srv_checksum_algorithm
the macro MYSQL_SYSVAR_ENUM() requires "long unsigned int" and if we use srv_checksum_algorithm_t her...
Definition: checksum.cc:57
uint32_t buf_calc_page_new_checksum(const byte *page)
Calculates a page checksum which is stored to the page when it is written to a file.
Definition: checksum.cc:98
const char * buf_checksum_algorithm_name(srv_checksum_algorithm_t algo)
Return a printable string describing the checksum algorithm.
Definition: checksum.cc:128
uint32_t buf_calc_page_old_checksum(const byte *page)
In versions < 4.0.14 and < 4.1.1 there was a bug that the checksum only looked at the first few bytes...
Definition: checksum.cc:121
uint32_t buf_calc_page_crc32(const byte *page, bool use_legacy_big_endian=false)
Calculates the CRC32 checksum of a page.
Definition: checksum.cc:71
The database buffer pool global types for the directory.
srv_checksum_algorithm_t
Alternatives for srv_checksum_algorithm, which can be changed by setting innodb_checksum_algorithm.
Definition: buf0types.h:115
Class to print checksums to log file.
Definition: buf0checksum.h:76
virtual void print_crc32_checksum(uint32_t checksum_field1, uint32_t checksum_field2) const
Print both new-style, old-style & crc32 checksum values.
Definition: buf0checksum.h:160
bool is_encrypted() const noexcept
Checks if a page is encrypted.
Definition: checksum.cc:265
virtual void report_empty_page(bool empty) const
Print message if page is empty.
Definition: buf0checksum.h:106
page_no_t page_no() const noexcept
Definition: checksum.cc:727
BlockReporter(bool check_lsn, const byte *read_buf, const page_size_t &page_size, bool skip_checksum)
Constructor.
Definition: buf0checksum.h:84
virtual void print_compressed_checksum(uint32_t calc, uint32_t stored) const
Print checksum values on a compressed page.
Definition: buf0checksum.h:174
virtual void print_strict_none(uint32_t checksum_field1, uint32_t checksum_field2, srv_checksum_algorithm_t algo) const
Print none checksum and the checksum fields in page.
Definition: buf0checksum.h:133
bool verify_zip_checksum() const
Verify a compressed page's checksum.
Definition: checksum.cc:531
bool is_corrupted() const
Checks if a page is corrupt.
Definition: checksum.cc:276
bool m_check_lsn
If true, do a LSN check during innodb recovery.
Definition: buf0checksum.h:247
uint32_t calc_zip_checksum(const byte *read_buf, ulint phys_page_size, srv_checksum_algorithm_t algo) const
Calculate the compressed page checksum.
Definition: checksum.cc:487
virtual void print_none_fail() const
Print a message that none check failed.
Definition: buf0checksum.h:169
BlockReporter(const BlockReporter &)=default
bool is_checksum_valid_crc32(uint32_t checksum_field1, uint32_t checksum_field2, const srv_checksum_algorithm_t algo, bool use_legacy_big_endian) const
Checks if the page is in crc32 checksum format.
Definition: checksum.cc:250
const page_size_t & m_page_size
Page size.
Definition: buf0checksum.h:251
bool m_skip_checksum
Skip checksum verification but compare only data.
Definition: buf0checksum.h:253
bool is_checksum_valid_none(uint32_t checksum_field1, uint32_t checksum_field2, const srv_checksum_algorithm_t algo) const
Checks if the page is in none checksum format.
Definition: checksum.cc:235
virtual void print_innodb_checksum(uint32_t old_checksum, uint32_t new_checksum, uint32_t checksum_field1, uint32_t checksum_field2, srv_checksum_algorithm_t algo) const
Print innodb checksum value stored in page trailer.
Definition: buf0checksum.h:146
virtual ~BlockReporter()=default
virtual void print_strict_crc32(uint32_t checksum_field1, uint32_t checksum_field2, uint32_t crc32, srv_checksum_algorithm_t algo) const
Print crc32 checksum and the checksum fields in page.
Definition: buf0checksum.h:113
virtual void print_strict_innodb(uint32_t checksum_field1, uint32_t checksum_field2) const
Print innodb checksum and the checksum fields in page.
Definition: buf0checksum.h:124
bool is_checksum_valid_innodb(uint32_t checksum_field1, uint32_t checksum_field2, const srv_checksum_algorithm_t algo) const
Checks if the page is in innodb checksum format.
Definition: checksum.cc:198
static bool is_lsn_valid(const byte *frame, uint32_t page_size) noexcept
Definition: checksum.cc:709
virtual void print_crc32_fail() const
Print a message that crc32 check failed.
Definition: buf0checksum.h:166
space_id_t space_id() const noexcept
Definition: checksum.cc:723
const byte * m_read_buf
Buffer holding the page.
Definition: buf0checksum.h:249
void page_warn_strict_checksum(srv_checksum_algorithm_t curr_algo, srv_checksum_algorithm_t page_checksum, const page_id_t &page_id) const
Issue a warning when the checksum that is stored in the page is valid, but different than the global ...
Definition: checksum.cc:663
virtual void print_innodb_fail() const
Print the message that checksum mismatch happened in page header.
Definition: buf0checksum.h:155
Page identifier.
Definition: buf0types.h:207
Page size descriptor.
Definition: page0size.h:50
int page
Definition: ctype-mb.cc:1224
bool empty(const Histogram &histogram)
Return true if 'histogram' was built on an empty table.
Definition: histogram.h:693
uint32_t crc32(const byte *buf, size_t len)
Computes CRC32-C hash not using any hardware acceleration.
Definition: crc32.cc:282
A class describing a page size.
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:406