MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
buf0checksum.cc File Reference
#include "univ.i"
#include "fil0fil.h"
#include "ut0crc32.h"
#include "ut0rnd.h"
#include "srv0srv.h"
#include "buf0types.h"
Include dependency graph for buf0checksum.cc:

Go to the source code of this file.

Functions

UNIV_INTERN ib_uint32_t buf_calc_page_crc32 (const byte *page)
UNIV_INTERN ulint buf_calc_page_new_checksum (const byte *page)
UNIV_INTERN ulint buf_calc_page_old_checksum (const byte *page)
UNIV_INTERN const char * buf_checksum_algorithm_name (srv_checksum_algorithm_t algo)

Variables

UNIV_INTERN ulong srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_INNODB

Detailed Description

Buffer pool checksum functions, also linked from /extra/innochecksum.cc

Created Aug 11, 2011 Vasil Dimov

Definition in file buf0checksum.cc.

Function Documentation

UNIV_INTERN ib_uint32_t buf_calc_page_crc32 ( const byte *  page)

Calculates a page CRC32 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.

Returns
checksum
Parameters
pagein: buffer page

Definition at line 51 of file buf0checksum.cc.

Here is the caller graph for this function:

UNIV_INTERN ulint 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.

Returns
checksum
Parameters
pagein: buffer page

Definition at line 81 of file buf0checksum.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN ulint 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!

Returns
checksum
Parameters
pagein: buffer page

Definition at line 115 of file buf0checksum.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN const char* buf_checksum_algorithm_name ( srv_checksum_algorithm_t  algo)

Return a printable string describing the checksum algorithm.

Returns
algorithm name
Parameters
algoin: algorithm

Definition at line 135 of file buf0checksum.cc.

Here is the caller graph for this function:

Variable Documentation

UNIV_INTERN 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

Definition at line 40 of file buf0checksum.cc.