Commit bf5c050f authored by Monty's avatar Monty

MDEV-25866 Upgrade from pre-10.5.10 to 10.5.10 causes CHECK errors on encrypted Aria tables

Hard to do a test case, but tested by hand and verified that mysql_upgrade
will update the encrypted MariaDB tables.
parent eed419b4
......@@ -4198,6 +4198,26 @@ int ha_maria::find_unique_row(uchar *record, uint constrain_no)
return rc;
}
/**
Check if a table needs to be repaired
*/
int ha_maria::check_for_upgrade(HA_CHECK_OPT *check)
{
if (table->s->mysql_version && table->s->mysql_version <= 100509 &&
(file->s->base.extra_options & MA_EXTRA_OPTIONS_ENCRYPTED))
{
/*
Encrypted tables before 10.5.9 had a bug where LSN was not
stored on the pages. These must be repaired!
*/
return HA_ADMIN_NEEDS_ALTER;
}
return HA_ADMIN_OK;
}
struct st_mysql_storage_engine maria_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
......
......@@ -144,6 +144,7 @@ class __attribute__((visibility("default"))) ha_maria :public handler
int check(THD * thd, HA_CHECK_OPT * check_opt) override;
int analyze(THD * thd, HA_CHECK_OPT * check_opt) override;
int repair(THD * thd, HA_CHECK_OPT * check_opt) override;
int check_for_upgrade(HA_CHECK_OPT *check_opt) override;
bool check_and_repair(THD * thd) override final;
bool is_crashed() const override final;
bool is_changed() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment