diff options
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sql/table.cc b/sql/table.cc index 2143faaff5c..133b08ba703 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3275,31 +3275,32 @@ bool TABLE_LIST::prep_check_option(THD *thd, uint8 check_opt_type) } -/* +/** Hide errors which show view underlying table information - SYNOPSIS - TABLE_LIST::hide_view_error() - thd thread handler + @param[in,out] thd thread handler + @pre This method can be called only if there is an error. */ void TABLE_LIST::hide_view_error(THD *thd) { /* Hide "Unknown column" or "Unknown function" error */ - if (thd->net.last_errno == ER_BAD_FIELD_ERROR || - thd->net.last_errno == ER_SP_DOES_NOT_EXIST || - thd->net.last_errno == ER_PROCACCESS_DENIED_ERROR || - thd->net.last_errno == ER_COLUMNACCESS_DENIED_ERROR || - thd->net.last_errno == ER_TABLEACCESS_DENIED_ERROR || - thd->net.last_errno == ER_TABLE_NOT_LOCKED || - thd->net.last_errno == ER_NO_SUCH_TABLE) + DBUG_ASSERT(thd->is_error()); + + if (thd->main_da.sql_errno() == ER_BAD_FIELD_ERROR || + thd->main_da.sql_errno() == ER_SP_DOES_NOT_EXIST || + thd->main_da.sql_errno() == ER_PROCACCESS_DENIED_ERROR || + thd->main_da.sql_errno() == ER_COLUMNACCESS_DENIED_ERROR || + thd->main_da.sql_errno() == ER_TABLEACCESS_DENIED_ERROR || + thd->main_da.sql_errno() == ER_TABLE_NOT_LOCKED || + thd->main_da.sql_errno() == ER_NO_SUCH_TABLE) { TABLE_LIST *top= top_table(); - thd->clear_error(); + thd->clear_error(); my_error(ER_VIEW_INVALID, MYF(0), top->view_db.str, top->view_name.str); } - else if (thd->net.last_errno == ER_NO_DEFAULT_FOR_FIELD) + else if (thd->main_da.sql_errno() == ER_NO_DEFAULT_FOR_FIELD) { TABLE_LIST *top= top_table(); thd->clear_error(); |