From a1eb15132720496bb30c31bc3d158db704b156c9 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Mon, 4 May 2020 19:11:02 +0530 Subject: [PATCH] MDEV-22410 Change the error when table schema mismatch happens - InnoDB gives "table is marked as crashed and should be repaired" when table schema mismatch. --- storage/innobase/handler/ha_innodb.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index be27bcd43decb..26a876c62447b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6084,7 +6084,6 @@ ha_innobase::open(const char* name, int, uint) sql_print_error("Failed to open table %s.\n", norm_name); } -no_such_table: set_my_errno(ENOENT); DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); @@ -6110,7 +6109,8 @@ ha_innobase::open(const char* name, int, uint) ib_table->file_unreadable = true; ib_table->corrupted = true; dict_table_close(ib_table, FALSE, FALSE); - goto no_such_table; + set_my_errno(ENOENT); + DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); } innobase_copy_frm_flags_from_table_share(ib_table, table->s);