diff --git a/sql/sql_executor.cc b/sql/sql_executor.cc index 0972dadbbc8..e4da6b8e407 100644 --- a/sql/sql_executor.cc +++ b/sql/sql_executor.cc @@ -1812,12 +1812,16 @@ int report_handler_error(TABLE *table, int error) table->status= STATUS_GARBAGE; return -1; // key not found; ok } + + if (error == HA_ERR_TABLESPACE_MISSING && !table->in_use->killed) + sql_print_error("The table '%s' doesn't have a corresponding tablespace", + table->s->table_name.str); /* Do not spam the error log with these temporary errors: LOCK_DEADLOCK LOCK_WAIT_TIMEOUT TABLE_DEF_CHANGED Also skip printing to error log if the current thread has been killed. */ - if (error != HA_ERR_LOCK_DEADLOCK && + else if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT && error != HA_ERR_TABLE_DEF_CHANGED && !table->in_use->killed) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 2b9be6f65ef..5d760657a7b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -9233,7 +9233,7 @@ ha_innobase::index_read( table->s->table_name.str); table->status = STATUS_NOT_FOUND; - error = HA_ERR_NO_SUCH_TABLE; + error = HA_ERR_TABLESPACE_MISSING; break; case DB_TABLESPACE_NOT_FOUND: