MySQL 8.0.40
Source Code Documentation
Audit_error_handler Class Referenceabstract

Error handler that controls error reporting by plugin. More...

Inheritance diagram for Audit_error_handler:
[legend]

Public Member Functions

 Audit_error_handler (THD *thd, const char *warning_message, bool active=true)
 Construction. More...
 
 ~Audit_error_handler () override
 Destruction. More...
 
virtual bool handle ()=0
 Simplified custom handler. More...
 
bool handle_condition (THD *, uint sql_errno, const char *sqlstate, Sql_condition::enum_severity_level *, const char *msg) override
 Error handler. More...
 
virtual void print_warning (const char *warn_msg, uint sql_errno, const char *sqlstate, const char *msg)
 Warning print routine. More...
 
int get_result (int result)
 Convert the result value returned from the audit api. More...
 

Private Member Functions

 Audit_error_handler (const Audit_error_handler &obj)
 Blocked copy constructor (private). More...
 

Private Attributes

THDm_thd
 Current thread data. More...
 
const char * m_warning_message
 Warning message used when the error is rejected. More...
 
bool m_error_reported
 Error has been reported. More...
 
const bool m_active
 Handler has been activated. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Internal_error_handler
 Internal_error_handler ()
 
Internal_error_handlerprev_internal_handler () const
 
virtual ~Internal_error_handler ()=default
 

Detailed Description

Error handler that controls error reporting by plugin.

Constructor & Destructor Documentation

◆ Audit_error_handler() [1/2]

Audit_error_handler::Audit_error_handler ( const Audit_error_handler obj)
inlineprivate

Blocked copy constructor (private).

◆ Audit_error_handler() [2/2]

Audit_error_handler::Audit_error_handler ( THD thd,
const char *  warning_message,
bool  active = true 
)
inline

Construction.

Parameters
thdCurrent thread data.
warning_messageWarning message used when error has been suppressed.
activeSpecifies whether the handler is active or not. Optional parameter (default is true).

◆ ~Audit_error_handler()

Audit_error_handler::~Audit_error_handler ( )
inlineoverride

Destruction.

Member Function Documentation

◆ get_result()

int Audit_error_handler::get_result ( int  result)
inline

Convert the result value returned from the audit api.

Parameters
resultResult value received from the plugin function.
Returns
Converted result value.

◆ handle()

virtual bool Audit_error_handler::handle ( )
pure virtual

Simplified custom handler.

Returns
True on error rejection, otherwise false.

Implemented in Ignore_event_error_handler, and Ignore_command_start_error_handler.

◆ handle_condition()

bool Audit_error_handler::handle_condition ( THD ,
uint  sql_errno,
const char *  sqlstate,
Sql_condition::enum_severity_level ,
const char *  msg 
)
inlineoverridevirtual

Error handler.

See also
Internal_error_handler::handle_condition
Returns
True on error rejection, otherwise false.

Implements Internal_error_handler.

◆ print_warning()

virtual void Audit_error_handler::print_warning ( const char *  warn_msg,
uint  sql_errno,
const char *  sqlstate,
const char *  msg 
)
inlinevirtual

Warning print routine.

Also prints the underlying error attributes if supplied.

Parameters
warn_msgWarning message to be printed.
sql_errnoThe error number of the underlying error
sqlstateThe SQL state of the underlying error. NULL if none
msgThe text of the underlying error. NULL if none

Reimplemented in Ignore_event_error_handler, and Ignore_command_start_error_handler.

Member Data Documentation

◆ m_active

const bool Audit_error_handler::m_active
private

Handler has been activated.

◆ m_error_reported

bool Audit_error_handler::m_error_reported
private

Error has been reported.

◆ m_thd

THD* Audit_error_handler::m_thd
private

Current thread data.

◆ m_warning_message

const char* Audit_error_handler::m_warning_message
private

Warning message used when the error is rejected.


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