Skip to content
Permalink
Browse files
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.
  • Loading branch information
montywi committed Jun 7, 2021
1 parent eed419b commit bf5c050
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
@@ -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;

0 comments on commit bf5c050

Please sign in to comment.