diff options
author | unknown <monty@hundin.mysql.fi> | 2001-11-18 14:33:53 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-11-18 14:33:53 +0200 |
commit | b87029d80cc3476b8c57e1a0770623d4ed3e9c0a (patch) | |
tree | 1187f38a1c1328c1f13ef771f484af421ee2566b /sql/ha_myisam.cc | |
parent | 21259d25f3e76801631dbde560a6da5a65aa00f3 (diff) | |
parent | 421595c12e731bb50e6fe6f9985d950e023e4667 (diff) | |
download | mariadb-git-b87029d80cc3476b8c57e1a0770623d4ed3e9c0a.tar.gz |
Merge
Docs/manual.texi:
Auto merged
innobase/btr/btr0btr.c:
Auto merged
innobase/btr/btr0cur.c:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/mysqld.cc:
Auto merged
mysql-test/t/myisam.test:
Auto merged
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r-- | sql/ha_myisam.cc | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index fafa4fe07d6..7a8585975cc 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -541,7 +541,7 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt) int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize) { int error=0; - uint extra_testflag=0; + uint local_testflag=param.testflag; bool optimize_done= !optimize, statistics_done=0; const char *old_proc_info=thd->proc_info; char fixed_name[FN_REFLEN]; @@ -570,19 +570,18 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize) (!param.opt_rep_quick || !(share->state.changed & STATE_NOT_OPTIMIZED_KEYS)))) { - ulonglong key_map= ((param.testflag & T_CREATE_MISSING_KEYS) ? + ulonglong key_map= ((local_testflag & T_CREATE_MISSING_KEYS) ? ((ulonglong) 1L << share->base.keys)-1 : share->state.key_map); + uint testflag=param.testflag; if (mi_test_if_sort_rep(file,file->state->records,key_map,0) && - (param.testflag & T_REP_BY_SORT)) + (local_testflag & T_REP_BY_SORT)) { - uint testflag=param.testflag; - extra_testflag= T_STATISTICS; + local_testflag|= T_STATISTICS; param.testflag|= T_STATISTICS; // We get this for free thd->proc_info="Repair by sorting"; statistics_done=1; error = mi_repair_by_sort(¶m, file, fixed_name, param.opt_rep_quick); - param.testflag=testflag; } else { @@ -590,22 +589,28 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize) param.testflag &= ~T_REP_BY_SORT; error= mi_repair(¶m, file, fixed_name, param.opt_rep_quick); } + param.testflag=testflag; + optimize_done=1; } if (!error) { - if ((param.testflag & T_SORT_INDEX) && + if ((local_testflag & T_SORT_INDEX) && (share->state.changed & STATE_NOT_SORTED_PAGES)) { optimize_done=1; thd->proc_info="Sorting index"; error=mi_sort_index(¶m,file,fixed_name); } - if (!statistics_done && (param.testflag & T_STATISTICS) && - (share->state.changed & STATE_NOT_ANALYZED)) + if (!statistics_done && (local_testflag & T_STATISTICS)) { - optimize_done=1; - thd->proc_info="Analyzing"; - error = chk_key(¶m, file); + if (share->state.changed & STATE_NOT_ANALYZED) + { + optimize_done=1; + thd->proc_info="Analyzing"; + error = chk_key(¶m, file); + } + else + local_testflag&= ~T_STATISTICS; // Don't update statistics } } thd->proc_info="Saving state"; @@ -620,10 +625,11 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize) file->save_state=file->s->state.state; if (file->s->base.auto_key) update_auto_increment_key(¶m, file, 1); - error = update_state_info(¶m, file, - UPDATE_TIME | UPDATE_OPEN_COUNT | - ((param.testflag | extra_testflag) & - T_STATISTICS ? UPDATE_STAT : 0)); + if (optimize_done) + error = update_state_info(¶m, file, + UPDATE_TIME | UPDATE_OPEN_COUNT | + (local_testflag & + T_STATISTICS ? UPDATE_STAT : 0)); info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE | HA_STATUS_CONST); if (rows != file->state->records && ! (param.testflag & T_VERY_SILENT)) |