summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-09-03 20:55:56 +0300
committerMichael Widenius <monty@askmonty.org>2010-09-03 20:55:56 +0300
commit9f85560212241f07b7bdff7df639c0b9a519bed5 (patch)
treecd03dd0ae30a3703f2c47ee887eb213a4825fdcf /sql/sql_table.cc
parenta4fff491eb7f8be7c635287377c57eeff1dd6e89 (diff)
downloadmariadb-git-9f85560212241f07b7bdff7df639c0b9a519bed5.tar.gz
Enable archive tables to work with mysql_upgrade / repair
Made long file names from previous patch shorter mysql-test/r/archive.result: Added testing of repair (for upgrade) of 5.0 tables. mysql-test/std_data/archive_5_0.ARM: Archive table created in MySQL 5.0 mysql-test/std_data/archive_5_0.ARZ: Archive table created in MySQL 5.0 mysql-test/std_data/archive_5_0.frm: Archive table created in MySQL 5.0 mysql-test/std_data/long_table_name.MYD: Made long file names shorter mysql-test/std_data/long_table_name.MYI: Made long file names shorter mysql-test/std_data/long_table_name.frm: Made long file names shorter mysql-test/t/archive.test: Added testing of repair (for upgrade) of 5.0 tables. sql/sql_table.cc: Allow recreate to open crashed tables. sql/table.cc: Fix error message if storage engine doesn't exists. storage/archive/azio.c: Reset status values in case archive is of old versions storage/archive/ha_archive.cc: Fix to allow one to open old versions of table during repair Reset status variables for old version tables If the the table is of old version, force upgrade with ALTER TABLE when doing repair storage/archive/ha_archive.h: Added variables to detect old versions
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index a0621dbbdcf..96be7c4437c 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4804,7 +4804,10 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
if (check_old_types == HA_ADMIN_NEEDS_ALTER ||
check_for_upgrade == HA_ADMIN_NEEDS_ALTER)
{
+ /* We use extra_open_options to be able to open crashed tables */
+ thd->open_options|= extra_open_options;
result_code= admin_recreate_table(thd, table);
+ thd->open_options= ~extra_open_options;
goto send_result;
}
if (check_old_types || check_for_upgrade)