![]() |
MySQL 9.0.0
Source Code Documentation
|
Buffer pool checksum functions, also linked from /extra/innochecksum.cc. More...
#include <sys/types.h>
#include <zlib.h>
#include "buf0buf.h"
#include "buf0types.h"
#include "fil0fil.h"
#include "fil0types.h"
#include "log0log.h"
#include "mach0data.h"
#include "my_dbug.h"
#include "page0size.h"
#include "srv0srv.h"
#include "univ.i"
#include "ut0crc32.h"
#include "ut0rnd.h"
Functions | |
uint32_t | buf_calc_page_crc32 (const byte *page, bool use_legacy_big_endian) |
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... | |
void | buf_page_lsn_check (bool check_lsn, const byte *read_buf) |
Do lsn checks on a page during innodb recovery. More... | |
std::ostream & | operator<< (std::ostream &out, const page_id_t &page_id) |
Print the given page_id_t object. More... | |
Variables | |
ulong | srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_INNODB |
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... | |
static bool | legacy_big_endian_checksum = false |
set if we have found pages matching legacy big endian checksum 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.
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!
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 |
|
inline |
Do lsn checks on a page during innodb recovery.
[in] | check_lsn | if recv_lsn_checks_on & check_lsn perform lsn check |
[in] | read_buf | buffer containing the page. |
std::ostream & operator<< | ( | std::ostream & | out, |
const page_id_t & | page_id | ||
) |
Print the given page_id_t object.
[in,out] | out | the output stream |
[in] | page_id | the page_id_t object to be printed |
|
static |
set if we have found pages matching legacy big endian checksum
ulong srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_INNODB |
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