From 9d68ccdeb8692b05d9cc0479d8d3757edbc49368 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 7 Nov 2010 14:25:29 +0200 Subject: Added option BACKUP_ALL to mysqld --myisam-recover to also get a backup of the index file before it's repaired. Removed wrong call to translog_buffer_unlock() that caused 'unlocking not locked mutex' failure in Aria log handler. extra/replace.c: Updated call to my_redel() include/maria.h: Updated prototype for maria_change_to_newfile include/my_sys.h: Updated prototypes Added my_create_backup_name include/myisam.h: Updated prototypes include/myisamchk.h: Added 'backup_time' to st_handler_check_param to be able to generate same name for backuped data and index file mysys/my_redel.c: Added time_t option to my_redel() to be able to generate same backup extensions for many files sql/handler.cc: Added start_time to st_ha_check_opt sql/handler.h: Added start_time to HA_CHECK_OPT sql/mysqld.cc: Added option BACKUP_ALL to --myisam-recover storage/maria/ha_maria.cc: Remember start time for repair storage/maria/ma_check.c: Use remembered start time for backup file names Removed some dead code storage/maria/ma_loghandler.c: Removed wrong call to translog_buffer_unlock() that caused 'unlocking not locked mutex' failure in log handler. storage/maria/maria_chk.c: Removed dead code (O_NEW_INDEX was never set) Report if table was 'crashed on repair' storage/maria/maria_pack.c: Updated parameters to my_redel() storage/myisam/ha_myisam.cc: Added recover option BACKUP_ALL to get a backup of the index file before it's repaired. Print information to log if we make a backup of data as part of repair. storage/myisam/ha_myisam.h: Added HA_RECOVER_FULL_BACKUP storage/myisam/mi_check.c: Use remembered start time for backup file names Added mi_make_backup_of_index() storage/myisam/myisamchk.c: Removed dead code (O_NEW_INDEX was never set) Report if table was 'crashed on repair' storage/myisam/myisampack.c: Updated call to my_redel() --- include/myisam.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/myisam.h') diff --git a/include/myisam.h b/include/myisam.h index 8413b7936e3..bf31a96b792 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -295,6 +295,8 @@ extern int mi_is_changed(struct st_myisam_info *info); extern int mi_delete_all_rows(struct st_myisam_info *info); extern ulong _mi_calc_blob_length(uint length , const uchar *pos); extern uint mi_get_pointer_length(ulonglong file_length, uint def); +extern int mi_make_backup_of_index(struct st_myisam_info *info, + time_t backup_time, myf flags); #define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for mmap file */ /* this is used to pass to mysql_myisamchk_table */ @@ -390,7 +392,8 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info, int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info, const char * name, int rep_quick); int change_to_newfile(const char * filename, const char * old_ext, - const char * new_ext, uint raid_chunks, + const char * new_ext, time_t backup_time, + uint raid_chunks, myf myflags); int lock_file(HA_CHECK *param, File file, my_off_t start, int lock_type, const char *filetype, const char *filename); -- cgit v1.2.1