MySQL 9.1.0
Source Code Documentation
|
An Internal_error_handler that suppresses errors regarding views' underlying tables that occur during privilege checking. More...
#include <error_handler.h>
Public Member Functions | |
View_error_handler (Table_ref *top_view) | |
bool | handle_condition (THD *thd, uint sql_errno, const char *, Sql_condition::enum_severity_level *level, const char *message) override |
Handle a sql condition. More... | |
Private Attributes | |
Table_ref * | m_top_view |
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 suppresses errors regarding views' underlying tables that occur during privilege checking.
It hides errors which show view underlying table information. This happens in the cases when
Access is denied for some table, column, function or stored procedure such as mentioned above. This error gets raised automatically, since we can't untangle its access checking from that of the view itself.
There are currently two mechanisms at work that handle errors for views based on an Internal_error_handler. This one and another one is Show_create_error_handler. The latter handles errors encountered during execution of SHOW CREATE VIEW, while this mechanism using this method is handles SELECT from views. The two methods should not clash.
|
inline |
|
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 |