MySQL 8.0.32
Source Code Documentation
Expected_errors Class Reference

Class representing a list of error codes passed as argument to mysqltest command –error. More...

#include <expected_errors.h>

Public Types

typedef std::vector< std::unique_ptr< Error > >::iterator iterator
 

Public Member Functions

 Expected_errors ()=default
 
 ~Expected_errors ()=default
 
iterator begin ()
 
iterator end ()
 
const char * sqlstate ()
 Return a sqlstate of the first error in the list. More...
 
error_type type ()
 Return an error type of the first error in the list. More...
 
std::size_t count ()
 Return length of the list containing errors. More...
 
std::string error_list ()
 Return list of error codes. More...
 
std::vector< std::uint32_t > errors ()
 Return list of error codes in the list. More...
 
unsigned int error_code ()
 Return an error code of the first error in the list. More...
 
void add_error (const char *sqlstate, error_type type)
 Add a new error to the existing list of errors. More...
 
void add_error (std::uint32_t error_code, error_type type)
 Add a new error to the existing list of errors. More...
 
void clear_list ()
 Delete all errors from the vector. More...
 

Private Attributes

std::vector< std::unique_ptr< Error > > m_errors
 

Detailed Description

Class representing a list of error codes passed as argument to mysqltest command –error.

Member Typedef Documentation

◆ iterator

typedef std::vector<std::unique_ptr<Error>>::iterator Expected_errors::iterator

Constructor & Destructor Documentation

◆ Expected_errors()

Expected_errors::Expected_errors ( )
default

◆ ~Expected_errors()

Expected_errors::~Expected_errors ( )
default

Member Function Documentation

◆ add_error() [1/2]

void Expected_errors::add_error ( const char *  sqlstate,
error_type  type 
)

Add a new error to the existing list of errors.

Parameters
sqlstateSQLSTATE string
typeError type

◆ add_error() [2/2]

void Expected_errors::add_error ( std::uint32_t  error_code,
error_type  type 
)

Add a new error to the existing list of errors.

Parameters
error_codeError number
typeError type

◆ begin()

iterator Expected_errors::begin ( )
inline

◆ clear_list()

void Expected_errors::clear_list ( )
inline

Delete all errors from the vector.

◆ count()

std::size_t Expected_errors::count ( )
inline

Return length of the list containing errors.

Return values
Lengthvalue

◆ end()

iterator Expected_errors::end ( )
inline

◆ error_code()

unsigned int Expected_errors::error_code ( )
inline

Return an error code of the first error in the list.

Return values
Errorcode

◆ error_list()

std::string Expected_errors::error_list ( )

Return list of error codes.

Return values
Listof error codes

◆ errors()

std::vector< unsigned int > Expected_errors::errors ( )

Return list of error codes in the list.

Return values
Listof error codes

◆ sqlstate()

const char * Expected_errors::sqlstate ( )
inline

Return a sqlstate of the first error in the list.

Return values
SQLSTATEstring

◆ type()

error_type Expected_errors::type ( )
inline

Return an error type of the first error in the list.

Return values
Errortype (ERR_ERRNO or ERR_SQLSTATE)

Member Data Documentation

◆ m_errors

std::vector<std::unique_ptr<Error> > Expected_errors::m_errors
private

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