From 74b064933267f58b9201c46eb67454237d7664d3 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 28 Mar 2012 13:22:21 +0300 Subject: Fixed lp:944422 "mysql_upgrade destroys Maria tables?" The issue was that check/optimize/anaylze did not zerofill the table before they started to work on it. Added one more element to not often used function handler::auto_repair() to allow handler to decide when to auto repair. mysql-test/suite/maria/r/maria-autozerofill.result: Test case for lp:944422 mysql-test/suite/maria/t/maria-autozerofill.test: Test case for lp:944422 sql/ha_partition.cc: Added argument to auto_repair() sql/ha_partition.h: Added argument to auto_repair() sql/handler.h: Added argument to auto_repair() sql/table.cc: Let auto_repair() decide which errors to trigger auto-repair storage/archive/ha_archive.h: Added argument to auto_repair() storage/csv/ha_tina.h: Added argument to auto_repair() storage/maria/ha_maria.cc: Give better error & warning messages for auto-repaired tables. storage/maria/ha_maria.h: Added argument to auto_repair() Always auto-repair in case of moved table. storage/maria/ma_open.c: Remove special handling of HA_ERR_OLD_FILE (this is now handled in auto_repair()) storage/myisam/ha_myisam.h: Added argument to auto_repair() --- storage/csv/ha_tina.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'storage/csv') diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 8572a53a94d..54860ecb3fb 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -151,6 +151,8 @@ public: int rnd_end(); int repair(THD* thd, HA_CHECK_OPT* check_opt); /* This is required for SQL layer to know that we support autorepair */ + bool auto_repair(int error) const + { return error == HA_ERR_CRASHED_ON_USAGE; } bool auto_repair() const { return 1; } void position(const uchar *record); int info(uint); -- cgit v1.2.1