MySQL 8.0.39
Source Code Documentation
|
Buffer pool checksum functions, also linked from /extra/innochecksum.cc. More...
Go to the source code of this file.
Classes | |
class | BlockReporter |
Class to print checksums to log file. More... | |
Functions | |
uint32_t | buf_calc_page_crc32 (const byte *page, bool use_legacy_big_endian=false) |
Calculates the CRC32 checksum of a page. More... | |
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. More... | |
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 of the page. More... | |
const char * | buf_checksum_algorithm_name (srv_checksum_algorithm_t algo) |
Return a printable string describing the checksum algorithm. More... | |
Variables | |
ulong | srv_checksum_algorithm |
the macro MYSQL_SYSVAR_ENUM() requires "long unsigned int" and if we use srv_checksum_algorithm_t here then we get a compiler error: ha_innodb.cc:12251: error: cannot convert 'srv_checksum_algorithm_t*' to 'long unsigned int*' in initialization More... | |
Buffer pool checksum functions, also linked from /extra/innochecksum.cc.
Created Aug 11, 2011 Vasil Dimov
uint32_t buf_calc_page_crc32 | ( | const byte * | page, |
bool | use_legacy_big_endian | ||
) |
Calculates the CRC32 checksum of a page.
The value is stored to the page when it is written to a file and also checked for a match when reading from the file. When reading we allow both normal CRC32 and CRC-legacy-big-endian variants. Note that we must be careful to calculate the same value on 32-bit and 64-bit architectures.
[in] | page | buffer page (UNIV_PAGE_SIZE bytes) |
[in] | use_legacy_big_endian | if true then use big endian byteorder when converting byte strings to integers |
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.
Note that we must be careful to calculate the same value on 32-bit and 64-bit architectures.
Note that we must be careful to calculate the same value on 32-bit and 64-bit architectures.
page | in: buffer page |
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 of the page.
This calculates that old checksum. NOTE: we must first store the new formula checksum to FIL_PAGE_SPACE_OR_CHKSUM before calculating and storing this old checksum because this takes that field as an input!
This calculates that old checksum. NOTE: we must first store the new formula checksum to FIL_PAGE_SPACE_OR_CHKSUM before calculating and storing this old checksum because this takes that field as an input!
page | in: buffer page |
const char * buf_checksum_algorithm_name | ( | srv_checksum_algorithm_t | algo | ) |
Return a printable string describing the checksum algorithm.
algo | in: algorithm |
|
extern |
the macro MYSQL_SYSVAR_ENUM() requires "long unsigned int" and if we use srv_checksum_algorithm_t here then we get a compiler error: ha_innodb.cc:12251: error: cannot convert 'srv_checksum_algorithm_t*' to 'long unsigned int*' in initialization