summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-05-04 18:43:37 +0200
committerunknown <serg@serg.mylan>2003-05-04 18:43:37 +0200
commitf3a1967bc976661ce717d5bee37cf92b03583c19 (patch)
tree977b5ccdb2fb4dc90d4ee35d6eeb47820e42f10a /sql/ha_myisam.cc
parent97946e16b3a667772586f244d36e1ff4de353ba4 (diff)
downloadmariadb-git-f3a1967bc976661ce717d5bee37cf92b03583c19.tar.gz
parallel-repair available in mysqld
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index aef9c09833a..202cd90fd88 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -579,10 +579,24 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool optimize)
{
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(&param, file, fixed_name,
- param.testflag & T_QUICK);
+ if (current_thd->variables.myisam_repair_threads>1)
+ {
+ char buf[40];
+ /* TODO: respect myisam_repair_threads variable */
+ my_snprintf(buf, 40, "Repair with %d threads", my_count_bits(key_map));
+ thd->proc_info=buf;
+ error = mi_repair_parallel(&param, file, fixed_name,
+ param.testflag & T_QUICK);
+ thd->proc_info="Repair done"; // to reset proc_info, as
+ // it was pointing to local buffer
+ }
+ else
+ {
+ thd->proc_info="Repair by sorting";
+ error = mi_repair_by_sort(&param, file, fixed_name,
+ param.testflag & T_QUICK);
+ }
}
else
{