MySQL  8.0.19
Source Code Documentation
Silence_routine_definer_errors Class Reference

If the defining user for a routine does not exist, then the ACL lookup code should raise two errors which we should intercept. More...

Inheritance diagram for Silence_routine_definer_errors:

Public Member Functions

 Silence_routine_definer_errors ()
virtual bool handle_condition (THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *level, const char *)
 Handle a sql condition. More...
bool has_errors () const

Private Attributes

bool is_grave

Additional Inherited Members

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

Detailed Description

If the defining user for a routine does not exist, then the ACL lookup code should raise two errors which we should intercept.

We convert the more descriptive error into a warning, and consume the other.

If any other errors are raised, then we set a flag that should indicate that there was some failure we should complain at a higher level.

Constructor & Destructor Documentation

◆ Silence_routine_definer_errors()

Silence_routine_definer_errors::Silence_routine_definer_errors ( )

Member Function Documentation

◆ handle_condition()

virtual bool Silence_routine_definer_errors::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.

◆ has_errors()

bool Silence_routine_definer_errors::has_errors ( ) const

Member Data Documentation

◆ is_grave

bool Silence_routine_definer_errors::is_grave

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