1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-35223 REPAIR does not fix MyISAM table with vector key after crash recovery

resort to alter for repair too
This commit is contained in:
Sergei Golubchik
2024-10-23 20:08:57 +02:00
parent e8cff8e829
commit 7d081c1b83
4 changed files with 52 additions and 1 deletions

View File

@@ -5366,6 +5366,14 @@ int handler::ha_check(THD *thd, HA_CHECK_OPT *check_opt)
}
if (unlikely((error= check(thd, check_opt))))
return error;
for (uint i= table->s->keys; i < table->s->total_keys; i++)
{
DBUG_ASSERT(table->s->hlindexes() == 1);
if (table->hlindex_open(i))
return HA_ADMIN_FAILED;
if ((error= table->hlindex->file->check(thd, check_opt)))
return error;
}
/* Skip updating frm version if not main handler. */
if (table->file != this || opt_readonly)
return error;
@@ -5424,7 +5432,7 @@ int handler::ha_repair(THD* thd, HA_CHECK_OPT* check_opt)
if (result == HA_ADMIN_OK && !opt_readonly &&
table->file->ha_check_for_upgrade(check_opt) == HA_ADMIN_OK)
result= update_frm_version(table);
return result;
return table->s->hlindexes() ? HA_ADMIN_TRY_ALTER : result;
}