MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / hide_view_error

Method hide_view_error

sql/table.cc:787–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

785*/
786
787void TABLE_LIST::hide_view_error(THD *thd)
788{
789 if (thd->killed || thd->get_internal_handler())
790 return;
791 /* Hide "Unknown column" or "Unknown function" error */
792 DBUG_ASSERT(thd->is_error());
793
794 switch (thd->get_stmt_da()->sql_errno()) {
795 case ER_BAD_FIELD_ERROR:
796 case ER_SP_DOES_NOT_EXIST:
797 case ER_FUNC_INEXISTENT_NAME_COLLISION:
798 case ER_PROCACCESS_DENIED_ERROR:
799 case ER_COLUMNACCESS_DENIED_ERROR:
800 case ER_TABLEACCESS_DENIED_ERROR:
801 case ER_TABLE_NOT_LOCKED:
802 case ER_NO_SUCH_TABLE:
803 {
804 TABLE_LIST *top= top_table();
805 thd->clear_error();
806 my_error(ER_VIEW_INVALID, MYF(0),
807 top->view_db.str, top->view_name.str);
808 break;
809 }
810
811 case ER_NO_DEFAULT_FOR_FIELD:
812 {
813 TABLE_LIST *top= top_table();
814 thd->clear_error();
815 // TODO: make correct error message
816 my_error(ER_NO_DEFAULT_FOR_VIEW_FIELD, MYF(0),
817 top->view_db.str, top->view_name.str);
818 break;
819 }
820 }
821}
822
823
824

Callers 1

view_error_processorFunction · 0.80

Calls 6

my_errorFunction · 0.85
get_internal_handlerMethod · 0.80
sql_errnoMethod · 0.80
get_stmt_daMethod · 0.80
clear_errorMethod · 0.80
is_errorMethod · 0.45

Tested by

no test coverage detected