MySQL 8.4.0
Source Code Documentation
View_metadata_updater_error_handler Class Referencefinal

A error handler to convert all the errors except deadlock, lock wait timeout and stack overrun to ER_VIEW_INVALID while updating views metadata. More...

Inheritance diagram for View_metadata_updater_error_handler:

Public Member Functions

bool handle_condition (THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *, const char *msg) override
 Handle a sql condition. More...
bool is_view_invalid () const
bool is_view_error_handled () const
 View_metadata_updater_error_handler ()
 ~View_metadata_updater_error_handler () override

Private Attributes

ErrorHandlerFunctionPointer m_old_error_handler_hook
uint m_sql_errno = 0
bool m_log_error = false

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

A error handler to convert all the errors except deadlock, lock wait timeout and stack overrun to ER_VIEW_INVALID while updating views metadata.

Even a warning ER_NO_SUCH_USER generated for non-existing user is handled with the error handler.

Constructor & Destructor Documentation

◆ View_metadata_updater_error_handler()

View_metadata_updater_error_handler::View_metadata_updater_error_handler ( )

◆ ~View_metadata_updater_error_handler()

View_metadata_updater_error_handler::~View_metadata_updater_error_handler ( )

Member Function Documentation

◆ handle_condition()

bool View_metadata_updater_error_handler::handle_condition ( THD thd,
uint  sql_errno,
const char *  sqlstate,
Sql_condition::enum_severity_level level,
const char *  msg 

Handle a sql condition.

This method can be implemented by a subclass to achieve any of the following:

  • mask a warning/error internally, prevent exposing it to the user,
  • mask a warning/error and throw another one instead. When this method returns true, the sql condition is considered 'handled', and will not be propagated to upper layers. It is the responsibility of the code installing an internal handler to then check for trapped conditions, and implement logic to recover from the anticipated conditions trapped during runtime.

This mechanism is similar to C++ try/throw/catch:

  • 'try' correspond to THD::push_internal_handler(),
  • 'throw' correspond to my_error(), which invokes my_message_sql(),
  • 'catch' correspond to checking how/if an internal handler was invoked, before removing it from the exception stack with THD::pop_internal_handler().
thdthe calling thread
sql_errnothe error number for the condition raised.
sqlstatethe SQLSTATE for the condition raised.
levelthe severity level for the condition raised.
msgthe error message for the condition raised.
true if the condition is handled

Implements Internal_error_handler.

◆ is_view_error_handled()

bool View_metadata_updater_error_handler::is_view_error_handled ( ) const

◆ is_view_invalid()

bool View_metadata_updater_error_handler::is_view_invalid ( ) const

Member Data Documentation

◆ m_log_error

bool View_metadata_updater_error_handler::m_log_error = false

◆ m_old_error_handler_hook

ErrorHandlerFunctionPointer View_metadata_updater_error_handler::m_old_error_handler_hook

◆ m_sql_errno

uint View_metadata_updater_error_handler::m_sql_errno = 0

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