diff options
author | unknown <serg@serg.mysql.com> | 2002-06-30 14:17:29 +0000 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2002-06-30 14:17:29 +0000 |
commit | 1158fd9f2e5934bdcf871791895bec58854c843c (patch) | |
tree | d21dcff9bca4b293a433b84b9356e37d0531494b /myisam/myisamchk.c | |
parent | ea01d6572a9d8187dcf70753d5bc420a9c2e139b (diff) | |
download | mariadb-git-1158fd9f2e5934bdcf871791895bec58854c843c.tar.gz |
"myisamchk -p" for parallel recover works (no extensive testing though)
include/my_sys.h:
make [un]lock_io_cache functions, not macro
some io_cache_share functions int->void
include/myisam.h:
mi_repair_by_sort_r -> mi_repair_parallel
MI_SORT_PARAM.master field for updating info->s.state struct
myisam/mi_check.c:
mi_repair_by_sort_r -> mi_repair_parallel
MI_SORT_PARAM.master field for updating info->s.state struct
myisam/sort.c:
my_thread_init()/my_thread_end()
misc bugfixes
mysys/mf_iocache.c:
io_cache_share functions int->void
comments added
[un]lock_io_cache functions added
Diffstat (limited to 'myisam/myisamchk.c')
-rw-r--r-- | myisam/myisamchk.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 6f12ce1536b..67fb693d6ee 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -216,9 +216,15 @@ static struct my_option my_long_options[] = {"recover", 'r', "Can fix almost anything except unique keys that aren't unique.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"paraller-recover", 'p', + "Same as '-r' but creates all the keys in parallel", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"safe-recover", 'o', "Uses old recovery method; Slower than '-r' but can handle a couple of cases where '-r' reports that it can't fix the data file.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"sort-recover", 'n', + "Force recovering with sorting even if the temporary file was very big.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"start-check-pos", OPT_START_CHECK_POS, "No help available.", 0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -244,9 +250,6 @@ static struct my_option my_long_options[] = (gptr*) &check_param.opt_sort_key, (gptr*) &check_param.opt_sort_key, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"sort-recover", 'n', - "Force recovering with sorting even if the temporary file was very big.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"tmpdir", 't', "Path for temporary files.", (gptr*) &check_param.tmpdir, @@ -514,6 +517,11 @@ get_one_option(int optid, if (argument != disabled_my_option) check_param.testflag|= T_REP_BY_SORT; break; + case 'p': + check_param.testflag&= ~T_REP_ANY; + if (argument != disabled_my_option) + check_param.testflag|= T_REP_PARALLEL; + break; case 'o': check_param.testflag&= ~T_REP_ANY; check_param.force_sort= 0; @@ -864,8 +872,7 @@ static int myisamchk(MI_CHECK *param, my_string filename) if (tmp != share->state.key_map) info->update|=HA_STATE_CHANGED; } - if (rep_quick && chk_del(param, info, - param->testflag & ~T_VERBOSE)) + if (rep_quick && chk_del(param, info, param->testflag & ~T_VERBOSE)) { if (param->testflag & T_FORCE_CREATE) { @@ -881,14 +888,17 @@ static int myisamchk(MI_CHECK *param, my_string filename) } if (!error) { - if ((param->testflag & T_REP_BY_SORT) && + if ((param->testflag & (T_REP_BY_SORT | T_REP_PARALLEL)) && (share->state.key_map || (rep_quick && !param->keys_in_use && !recreate)) && mi_test_if_sort_rep(info, info->state->records, info->s->state.key_map, param->force_sort)) { - error=mi_repair_by_sort(param,info,filename,rep_quick); + if (param->testflag & T_REP_BY_SORT) + error=mi_repair_by_sort(param,info,filename,rep_quick); + else + error=mi_repair_parallel(param,info,filename,rep_quick); state_updated=1; } else if (param->testflag & T_REP_ANY) |