MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Show_create_error_handler Class Reference

Public Member Functions

 Show_create_error_handler (THD *thd, TABLE_LIST *top_view)
char * get_view_access_denied_message ()
bool handle_condition (THD *thd, uint sql_errno, const char *, Sql_condition::enum_warning_level level, const char *message, Sql_condition **)

Detailed Description

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

  • A view's underlying table (e.g. referenced in its SELECT list) does not exist. There should not be an error as no attempt was made to access it per se.
  • 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.

Definition at line 719 of file sql_show.cc.

Constructor & Destructor Documentation

Show_create_error_handler::Show_create_error_handler ( THD *  thd,
TABLE_LIST top_view 
)
inlineexplicit

Creates a new Show_create_error_handler for the particular security context and view.

Thread context, used for security context information if needed. 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.

Definition at line 738 of file sql_show.cc.

Member Function Documentation

char* Show_create_error_handler::get_view_access_denied_message ( )
inline

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.

Definition at line 756 of file sql_show.cc.

Here is the call graph for this function:


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