From 365bbf9814c98292b0ae0a69ad9c448971c53b99 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Jul 2007 13:07:01 +0500 Subject: [PATCH] Fix for bug #29980: 5.1.20 ate my table Problem: trying to repair an old (e.g. with "old" varstring fields) corrupted table with use_frm option we don't actually repair the table, just altering it which may couse data loss. Fix: if use_frm repair option is set, do repair instead of altering even if the table needs upgrade. sql/sql_table.cc: Fix for bug #29980: 5.1.20 ate my table --- sql/sql_table.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 70bd549612c..fe62ac858ac 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4132,7 +4132,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, goto err; } - if (operator_func == &handler::ha_repair) + if (operator_func == &handler::ha_repair && + !(check_opt->sql_flags & TT_USEFRM)) { if ((table->table->file->check_old_types() == HA_ADMIN_NEEDS_ALTER) || (table->table->file->ha_check_for_upgrade(check_opt) ==