diff --git a/sql/handler.cc b/sql/handler.cc index 9ded738055e..58d37532796 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3009,7 +3009,7 @@ void handler::print_error(int error, myf errflag) textno=ER_TABLE_DEF_CHANGED; break; case HA_ERR_NO_SUCH_TABLE: - my_error(ER_NO_SUCH_TABLE, errflag, table_share->db.str, + my_error(ER_NO_SUCH_TABLE_IN_ENGINE, errflag, table_share->db.str, table_share->table_name.str); DBUG_VOID_RETURN; case HA_ERR_RBR_LOGGING_FAILED: diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index b883ec8df03..99bf8a82004 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -314,7 +314,7 @@ unpack_row(Relay_log_info const *rli, if (!pack_ptr) { rli->report(ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT, - "Could not read field %`s of table %`s.%`s", + "Could not read field '%s' of table '%s.%s'", f->field_name, table->s->db.str, table->s->table_name.str); DBUG_RETURN(ER_SLAVE_CORRUPT_EVENT); diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 923e8e73bc7..31a6f13e52f 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6585,3 +6585,6 @@ ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION eng "Cannot modify @@session.skip_replication inside a stored function or trigger" ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT eng "Query execution was interrupted. The query examined at least %llu rows, which exceeds LIMIT ROWS EXAMINED (%llu). The query result may be incomplete." +ER_NO_SUCH_TABLE_IN_ENGINE 42S02 + eng "Table '%-.192s.%-.192s' doesn't exist in engine" + swe "Det finns ingen tabell som heter '%-.192s.%-.192s' i handlern" diff --git a/sql/sp.cc b/sql/sp.cc index 29195234a5a..93cd64b4104 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1429,6 +1429,7 @@ public: MYSQL_ERROR ** cond_hdl) { if (sql_errno == ER_NO_SUCH_TABLE || + sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE || sql_errno == ER_CANNOT_LOAD_FROM_TABLE || sql_errno == ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE || sql_errno == ER_COL_COUNT_DOESNT_MATCH_CORRUPTED) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 9a356cb3321..f3ba0073c69 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -3032,6 +3032,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, if (!res || !thd->is_error() || (thd->stmt_da->sql_errno() != ER_CANT_REOPEN_TABLE && thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE && + thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE_IN_ENGINE && thd->stmt_da->sql_errno() != ER_UPDATE_TABLE_USED)) thd->stmt_arena->state= Query_arena::STMT_EXECUTED; diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 8d0f2e5634f..c65e56edbe0 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -285,6 +285,7 @@ end: static inline bool table_not_corrupt_error(uint sql_errno) { return (sql_errno == ER_NO_SUCH_TABLE || + sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE || sql_errno == ER_FILE_NOT_FOUND || sql_errno == ER_LOCK_WAIT_TIMEOUT || sql_errno == ER_LOCK_DEADLOCK || diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 95b1843f5e1..52569f193aa 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -70,7 +70,7 @@ No_such_table_error_handler::handle_condition(THD *, MYSQL_ERROR ** cond_hdl) { *cond_hdl= NULL; - if (sql_errno == ER_NO_SUCH_TABLE) + if (sql_errno == ER_NO_SUCH_TABLE || sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE) { m_handled_errors++; return TRUE; @@ -144,7 +144,9 @@ Repair_mrg_table_error_handler::handle_condition(THD *, MYSQL_ERROR ** cond_hdl) { *cond_hdl= NULL; - if (sql_errno == ER_NO_SUCH_TABLE || sql_errno == ER_WRONG_MRG_TABLE) + if (sql_errno == ER_NO_SUCH_TABLE || + sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE || + sql_errno == ER_WRONG_MRG_TABLE) { m_handled_errors= true; return TRUE; @@ -717,7 +719,9 @@ get_table_share_with_discover(THD *thd, TABLE_LIST *table_list, @todo Rework alternative ways to deal with ER_NO_SUCH TABLE. */ - if (share || (thd->is_error() && thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE)) + if (share || + (thd->is_error() && thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE && + thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE_IN_ENGINE)) DBUG_RETURN(share); *error= 0; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 5e3095181ee..8a106b8ec6f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -660,6 +660,7 @@ public: break; case ER_NO_SUCH_TABLE: + case ER_NO_SUCH_TABLE_IN_ENGINE: /* Established behavior: warn if underlying tables are missing. */ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_VIEW_INVALID, diff --git a/sql/table.cc b/sql/table.cc index b8161093e9a..d733c5ada62 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4393,7 +4393,7 @@ bool TABLE_LIST::prep_check_option(THD *thd, uint8 check_opt_type) There are currently two mechanisms at work that handle errors for views, this one and a more general mechanism based on an Internal_error_handler, see Show_create_error_handler. The latter handles errors encountered during - execution of SHOW CREATE VIEW, while the machanism using this method is + execution of SHOW CREATE VIEW, while the mechanism using this method is handles SELECT from views. The two methods should not clash. @param[in,out] thd thread handler