MySQL 8.0.39
Source Code Documentation
|
An Internal_error_handler that suppresses errors regarding views' underlying tables that occur during privilege checking within SHOW CREATE VIEW commands. More...
Public Member Functions | |
Show_create_error_handler (THD *thd, Table_ref *top_view) | |
Creates a new Show_create_error_handler for the particular security context and view. More... | |
bool | handle_condition (THD *thd, uint sql_errno, const char *, Sql_condition::enum_severity_level *, const char *msg) override |
Handle a sql condition. More... | |
Private Member Functions | |
const char * | get_view_access_denied_message (THD *thd) |
Lazy instantiation of 'view access denied' message. More... | |
Private Attributes | |
Table_ref * | m_top_view |
bool | m_handling |
Security_context * | m_sctx |
char | m_view_access_denied_message [MYSQL_ERRMSG_SIZE] |
const char * | m_view_access_denied_message_ptr |
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 within SHOW CREATE VIEW commands.
This happens in the cases when
|
inlineexplicit |
Creates a new Show_create_error_handler for the particular security context and view.
thd | Thread context, used for security context information if needed. |
top_view | The view. We do not verify at this point that top_view is in fact a view since, alas, these things do not stay constant. |
|
inlineprivate |
Lazy instantiation of 'view access denied' message.
The purpose of the Show_create_error_handler is to hide details of underlying tables for which we have no privileges behind ER_VIEW_INVALID messages. But this obviously does not apply if we lack privileges on the view itself. Unfortunately the information about for which table privilege checking failed is not available at this point. The only way for us to check is by reconstructing the actual error message and see if it's the same.
|
inlineoverridevirtual |
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 |
|
private |
|
private |
|
private |