50 bool use_legacy_big_endian =
false);
114 uint32_t checksum_field2
116 uint32_t
crc32 [[maybe_unused]],
118 [[maybe_unused]])
const {}
125 uint32_t checksum_field2
126 [[maybe_unused]])
const {}
134 uint32_t checksum_field2
137 [[maybe_unused]])
const {}
146 uint32_t old_checksum [[maybe_unused]],
147 uint32_t new_checksum [[maybe_unused]],
148 uint32_t checksum_field1 [[maybe_unused]],
149 uint32_t checksum_field2 [[maybe_unused]],
161 uint32_t checksum_field2
162 [[maybe_unused]])
const {}
175 [[maybe_unused]])
const {}
199 [[nodiscard]]
static bool is_lsn_valid(
const byte *frame,
200 uint32_t page_size)
noexcept;
209 uint32_t checksum_field2,
218 uint32_t checksum_field2,
228 uint32_t checksum_field2,
230 bool use_legacy_big_endian)
const;
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:50
uint32_t page_no_t
Page number.
Definition: api0api.h:48
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:56
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:97
const char * buf_checksum_algorithm_name(srv_checksum_algorithm_t algo)
Return a printable string describing the checksum algorithm.
Definition: checksum.cc:127
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:120
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:70
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:114
Class to print checksums to log file.
Definition: buf0checksum.h:75
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:159
bool is_encrypted() const noexcept
Checks if a page is encrypted.
Definition: checksum.cc:264
virtual void report_empty_page(bool empty) const
Print message if page is empty.
Definition: buf0checksum.h:105
page_no_t page_no() const noexcept
Definition: checksum.cc:734
BlockReporter(bool check_lsn, const byte *read_buf, const page_size_t &page_size, bool skip_checksum)
Constructor.
Definition: buf0checksum.h:83
virtual void print_compressed_checksum(uint32_t calc, uint32_t stored) const
Print checksum values on a compressed page.
Definition: buf0checksum.h:173
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:132
bool verify_zip_checksum() const
Verify a compressed page's checksum.
Definition: checksum.cc:530
bool is_corrupted() const
Checks if a page is corrupt.
Definition: checksum.cc:275
bool m_check_lsn
If true, do a LSN check during innodb recovery.
Definition: buf0checksum.h:246
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:486
virtual void print_none_fail() const
Print a message that none check failed.
Definition: buf0checksum.h:168
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:249
const page_size_t & m_page_size
Page size.
Definition: buf0checksum.h:250
bool m_skip_checksum
Skip checksum verification but compare only data.
Definition: buf0checksum.h:252
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:234
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:145
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:112
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:123
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:197
static bool is_lsn_valid(const byte *frame, uint32_t page_size) noexcept
Definition: checksum.cc:716
virtual void print_crc32_fail() const
Print a message that crc32 check failed.
Definition: buf0checksum.h:165
space_id_t space_id() const noexcept
Definition: checksum.cc:730
const byte * m_read_buf
Buffer holding the page.
Definition: buf0checksum.h:248
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:670
virtual void print_innodb_fail() const
Print the message that checksum mismatch happened in page header.
Definition: buf0checksum.h:154
Page identifier.
Definition: buf0types.h:206
Page size descriptor.
Definition: page0size.h:49
int page
Definition: ctype-mb.cc:1233
bool empty(const Histogram &histogram)
Return true if 'histogram' was built on an empty table.
Definition: histogram.h:651
uint32_t crc32(const byte *buf, size_t len)
Computes CRC32-C hash not using any hardware acceleration.
Definition: crc32.cc:281
A class describing a page size.
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:405