MySQL 9.1.0
Source Code Documentation
Binlog_read_error Class Reference

It defines the error types which could happen when reading binlog files or deserializing binlog events. More...

#include <binlog_istream.h>

Public Types

enum  Error_type {
  SUCCESS = 0 , READ_EOF = 1 , BOGUS , SYSTEM_IO ,
  MEM_ALLOCATE , TRUNC_EVENT , TRUNC_FD_EVENT , EVENT_TOO_LARGE ,
  CHECKSUM_FAILURE , INVALID_EVENT , CANNOT_OPEN , HEADER_IO_FAILURE ,
  BAD_BINLOG_MAGIC , INVALID_ENCRYPTION_HEADER , CANNOT_GET_FILE_PASSWORD , READ_ENCRYPTED_LOG_FILE_IS_NOT_SUPPORTED ,
  ERROR_DECRYPTING_FILE , EVENT_UNSUPPORTED_NEW_VERSION
}
 Possible errors which happens when reading an event. More...
 

Public Member Functions

 Binlog_read_error ()=default
 
 Binlog_read_error (Error_type type)
 
bool has_error () const
 
bool has_fatal_error () const
 
Error_type get_type () const
 Return the error encountered when reading events. More...
 
const char * get_str () const
 Return error message of the error type. More...
 
bool set_type (Error_type type)
 Set m_error to error. More...
 

Private Attributes

Error_type m_type = SUCCESS
 

Detailed Description

It defines the error types which could happen when reading binlog files or deserializing binlog events.

String error message of the error types are defined as well. It has a member variable to store an error type and provides a few functions to check the error type stored in the member variable.

Member Enumeration Documentation

◆ Error_type

Possible errors which happens when reading an event.

Enumerator
SUCCESS 
READ_EOF 
BOGUS 
SYSTEM_IO 
MEM_ALLOCATE 
TRUNC_EVENT 
TRUNC_FD_EVENT 
EVENT_TOO_LARGE 
CHECKSUM_FAILURE 
INVALID_EVENT 
CANNOT_OPEN 
HEADER_IO_FAILURE 
BAD_BINLOG_MAGIC 
INVALID_ENCRYPTION_HEADER 
CANNOT_GET_FILE_PASSWORD 
READ_ENCRYPTED_LOG_FILE_IS_NOT_SUPPORTED 
ERROR_DECRYPTING_FILE 
EVENT_UNSUPPORTED_NEW_VERSION 

Constructor & Destructor Documentation

◆ Binlog_read_error() [1/2]

Binlog_read_error::Binlog_read_error ( )
default

◆ Binlog_read_error() [2/2]

Binlog_read_error::Binlog_read_error ( Error_type  type)
inline

Member Function Documentation

◆ get_str()

const char * Binlog_read_error::get_str ( ) const

Return error message of the error type.

Returns
It will return nullptr if m_type is SUCCESS. In practice, it should never be called if m_type is SUCCESS. So an assertion is added in debug mode which predicts m_type is not SUCCESS.

◆ get_type()

Error_type Binlog_read_error::get_type ( ) const
inline

Return the error encountered when reading events.

◆ has_error()

bool Binlog_read_error::has_error ( ) const
inline

◆ has_fatal_error()

bool Binlog_read_error::has_fatal_error ( ) const
inline

◆ set_type()

bool Binlog_read_error::set_type ( Error_type  type)
inline

Set m_error to error.

Parameters
[in]typeThe error type will be set
Return values
falseIf error is SUCCESS
trueIf error is not SUCCESS.

Member Data Documentation

◆ m_type

Error_type Binlog_read_error::m_type = SUCCESS
private

The documentation for this class was generated from the following files: