diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-01-18 17:36:20 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-01-18 17:36:20 -0700 |
commit | 1ad779d47c5e7b1e4e044053f9fa8bca71ac9e2b (patch) | |
tree | 6be6f043d9869e97211581cece15de29cc37352f /sql/ha_myisam.cc | |
parent | c862fa36467651ef3e3cb3acad61e42fc0b3e07c (diff) | |
download | mariadb-git-1ad779d47c5e7b1e4e044053f9fa8bca71ac9e2b.tar.gz |
fixed buffer overrun in resolve_stack_dump
fixes for restore table
test case for backup/restore
extra/resolve_stack_dump.c:
fixed buffer overrun
mysql-test/t/rpl000004.test:
updated load table from master test case
sql/ha_myisam.cc:
verbose error messages during backup table, very silent repair on restore
sql/sql_table.cc:
fixed bugs in restore table
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r-- | sql/ha_myisam.cc | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 7e6c4a697fa..ac88c802949 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -375,6 +375,7 @@ int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt) tmp_check_opt.init(); tmp_check_opt.quick = 1; + tmp_check_opt.flags |= T_VERY_SILENT; return repair(thd, &tmp_check_opt); err: @@ -396,24 +397,52 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt) char* backup_dir = thd->lex.backup_dir; char src_path[FN_REFLEN], dst_path[FN_REFLEN]; char* table_name = table->real_name; + int error = 0; + const char* errmsg = ""; + if (!fn_format(dst_path, table_name, backup_dir, reg_ext, 4 + 64)) - return HA_ADMIN_INVALID; + { + errmsg = "failed in fn_format() for .frm file: errno=%d"; + error = HA_ADMIN_INVALID; + goto err; + } + if (my_copy(fn_format(src_path, table->path,"", reg_ext, 4), dst_path, MYF(MY_WME | MY_HOLD_ORIGINAL_MODES ))) { - return HA_ADMIN_FAILED; + error = HA_ADMIN_FAILED; + errmsg = "Failed copying .frm file: errno = %d"; + goto err; } if (!fn_format(dst_path, table_name, backup_dir, MI_NAME_DEXT, 4 + 64)) - return HA_ADMIN_INVALID; + { + errmsg = "failed in fn_format() for .MYD file: errno=%d"; + error = HA_ADMIN_INVALID; + goto err; + } if (my_copy(fn_format(src_path, table->path,"", MI_NAME_DEXT, 4), dst_path, MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )) ) - return HA_ADMIN_FAILED; - + { + errmsg = "Failed copying .MYD file: errno = %d"; + error= HA_ADMIN_FAILED; + goto err; + } return HA_ADMIN_OK; + err: + { + MI_CHECK param; + myisamchk_init(¶m); + param.thd = thd; + param.op_name = (char*)"backup"; + param.table_name = table->table_name; + param.testflag = 0; + mi_check_print_error(¶m,errmsg, errno ); + return error; + } } |