MySQL 8.0.39
Source Code Documentation
|
An Internal_error_handler that converts errors related to foreign key constraint checks 'ER_NO_REFERENCED_ROW_2' and 'ER_ROW_IS_REFERENCED_2' to ER_NO_REFERENCED_ROW and ER_ROW_IS_REFERENCED based on privilege checks. More...
#include <error_handler.h>
Public Member Functions | |
Foreign_key_error_handler (THD *thd, handler *table_handler) | |
bool | handle_condition (THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *level, const char *message) override |
Handle a sql condition. More... | |
Private Attributes | |
handler * | m_table_handler |
THD * | m_thd |
Additional Inherited Members | |
Protected Member Functions inherited from Internal_error_handler | |
Internal_error_handler () | |
Internal_error_handler * | prev_internal_handler () const |
virtual | ~Internal_error_handler ()=default |
An Internal_error_handler that converts errors related to foreign key constraint checks 'ER_NO_REFERENCED_ROW_2' and 'ER_ROW_IS_REFERENCED_2' to ER_NO_REFERENCED_ROW and ER_ROW_IS_REFERENCED based on privilege checks.
This prevents from revealing parent and child tables information respectively when the foreign key constraint check fails and user does not have privileges to access those tables.
|
overridevirtual |
Handle a sql condition.
This method can be implemented by a subclass to achieve any of the following:
This mechanism is similar to C++ try/throw/catch:
THD::push_internal_handler()
,my_error()
, which invokes my_message_sql()
,THD::pop_internal_handler()
.thd | the calling thread |
sql_errno | the error number for the condition raised. |
sqlstate | the SQLSTATE for the condition raised. |
level | the severity level for the condition raised. |
msg | the error message for the condition raised. |
Implements Internal_error_handler.
|
private |
|
private |