diff options
author | unknown <monty@donna.mysql.com> | 2001-01-31 04:47:25 +0200 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2001-01-31 04:47:25 +0200 |
commit | 495231ea25a82d97e69e96ff9e5d7688434cfff2 (patch) | |
tree | 851a8ba92ed9883efe2504e0726aae6843c317c0 /myisam/myisamchk.c | |
parent | bf1f8fd3eb4b98dadd265f8ed10d92220dabe1bb (diff) | |
download | mariadb-git-495231ea25a82d97e69e96ff9e5d7688434cfff2.tar.gz |
New myisamchk option --sort-recover
Allow delete of crashed MyISAM tables
Fixed bug when BLOB was first part of key
Fixed bug when using result from CASE in GROUP BY
Fixed core-dump bug in monthname()
Optimized calling of check_db_name()
Docs/manual.texi:
Added more information about myisamchk
client/mysqladmin.c:
Added error message for CREATE database and fixed possible overflow bug
include/myisam.h:
New myisamchk option --sort-recover
libmysql/libmysql.c:
Removed commented code
Don't define getpwuid (breaks on SCO 3.2)
myisam/mi_check.c:
Fixed (new) bug when using --recover --optimize
myisam/mi_delete_table.c:
Allow delete of crashed tables
myisam/mi_key.c:
Fixed bug when BLOB was first part of key
myisam/myisamchk.c:
New myisamchk option --sort-recover
mysql-test/r/case.result:
New test cases to check for reported bugs
mysql-test/r/func_time.result:
New test cases to check for reported bugs
mysql-test/r/type_blob.result:
New test cases to check for reported bugs
mysql-test/r/type_datetime.result:
New test cases to check for reported bugs
mysql-test/t/case.test:
New test cases to check for reported bugs
mysql-test/t/func_time.test:
New test cases to check for reported bugs
mysql-test/t/type_blob.test:
New test cases to check for reported bugs
mysql-test/t/type_datetime.test:
New test cases to check for reported bugs
mysys/my_bitmap.c:
Optimize
sql-bench/limits/ms-sql.cfg:
Updated limits
sql/item_cmpfunc.cc:
Fixed bug when using result from CASE in GROUP BY
sql/item_cmpfunc.h:
Fixed bug when using result from CASE in GROUP BY
sql/item_timefunc.cc:
Fixed core-dump bug in monthname()
sql/sql_db.cc:
Optimized calling of check_db_name()
sql/sql_parse.cc:
Optimized calling of check_db_name()
sql/table.cc:
Fixed typo
Diffstat (limited to 'myisam/myisamchk.c')
-rw-r--r-- | myisam/myisamchk.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 8e794b7e708..7c86ea14c2d 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -189,6 +189,7 @@ static struct option long_options[] = {"silent", no_argument, 0, 's'}, {"sort-index", no_argument, 0, 'S'}, {"sort-records", required_argument, 0, 'R'}, + {"sort-recover", no_argument, 0, 'n'}, {"tmpdir", required_argument, 0, 't'}, {"update-state", no_argument, 0, 'U'}, {"unpack", no_argument, 0, 'u'}, @@ -200,7 +201,7 @@ static struct option long_options[] = static void print_version(void) { - printf("%s Ver 1.41 for %s at %s\n",my_progname,SYSTEM_TYPE, + printf("%s Ver 1.42 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE); } @@ -255,9 +256,11 @@ static void usage(void) myisamchk repairs the table a symlink points at.\n\ -r, --recover Can fix almost anything except unique keys that aren't\n\ unique.\n\ + -n, --sort-recover Force recovering with sorting even if the temporary\n\ + file would be very big.\n\ -o, --safe-recover Uses old recovery method; Slower than '-r' but can\n\ - handle a couple of cases where '-r' reports that it can't\n\ - fix the data file.\n\ + handle a couple of cases where '-r' reports that it\n\ + can't fix the data file.\n\ --character-sets-dir=...\n\ Directory where character sets are\n\ --set-character-set=name\n\ @@ -306,7 +309,8 @@ static void get_options(register int *argc,register char ***argv) set_all_changeable_vars(changeable_vars); if (isatty(fileno(stdout))) check_param.testflag|=T_WRITE_LOOP; - while ((c=getopt_long(*argc,*argv,"aBcCdeifF?lqrmosSTuUvVw#:b:D:k:O:R:A::t:", + while ((c=getopt_long(*argc,*argv, + "aBcCdeifF?lqrmnosSTuUvVw#:b:D:k:O:R:A::t:", long_options, &option_index)) != EOF) { switch(c) { @@ -374,8 +378,13 @@ static void get_options(register int *argc,register char ***argv) break; case 'o': check_param.testflag= (check_param.testflag & ~T_REP_BY_SORT) | T_REP; + check_param.force_sort=0; my_disable_async_io=1; /* More safety */ break; + case 'n': + check_param.testflag= (check_param.testflag & ~T_REP) | T_REP_BY_SORT; + check_param.force_sort=1; + break; case 'q': check_param.opt_rep_quick++; break; @@ -683,7 +692,8 @@ static int myisamchk(MI_CHECK *param, my_string filename) if ((param->testflag & T_REP_BY_SORT) && (share->state.key_map || (rep_quick && !param->keys_in_use && !recreate)) && - mi_test_if_sort_rep(info, info->state->records, 1)) + mi_test_if_sort_rep(info, info->state->records, + check_param.force_sort)) { error=mi_repair_by_sort(&check_param,info,fixed_name,rep_quick); state_updated=1; |