summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-06-25 18:49:36 +0300
committermonty@mysql.com <>2004-06-25 18:49:36 +0300
commitf6765146c1b97bbb71f79adbd275dc2b6ca79333 (patch)
tree3a9126456bcc45a3caaf4b6c53da125de2769da8 /sql/ha_myisam.cc
parent00dc9a0e91835f4cae34d287b4351667fe7fe4dc (diff)
downloadmariadb-git-f6765146c1b97bbb71f79adbd275dc2b6ca79333.tar.gz
Added missing root user to mysql.user on windows. (Bug #4242)
Set default max_allowed_packet to be able to read help tables even if an my.cnf file with this option is present. (Bug #3938) Don't use default arguments for ha_rnd_init() Simple code cleanups since last pull
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc47
1 files changed, 24 insertions, 23 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index fc203d14d19..77615d68fe4 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -1004,8 +1004,10 @@ bool ha_myisam::check_and_repair(THD *thd)
{
int error=0;
int marked_crashed;
+ char *old_query;
+ uint old_query_length;
HA_CHECK_OPT check_opt;
- DBUG_ENTER("ha_myisam::auto_check_and_repair");
+ DBUG_ENTER("ha_myisam::check_and_repair");
check_opt.init();
check_opt.flags= T_MEDIUM | T_AUTO_REPAIR;
@@ -1013,30 +1015,29 @@ bool ha_myisam::check_and_repair(THD *thd)
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
check_opt.flags|=T_QUICK;
sql_print_error("Warning: Checking table: '%s'",table->path);
- if ((marked_crashed=mi_is_crashed(file)))
+
+ old_query= thd->query;
+ old_query_length= thd->query_length;
+ pthread_mutex_lock(&LOCK_thread_count);
+ thd->query= table->real_name;
+ thd->query_length= strlen(table->real_name);
+ pthread_mutex_unlock(&LOCK_thread_count);
+
+ if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{
- char *old_query= thd->query;
- uint old_query_length= thd->query_length;
- pthread_mutex_lock(&LOCK_thread_count);
- thd->query= table->real_name;
- thd->query_length= strlen(table->real_name);
- pthread_mutex_unlock(&LOCK_thread_count);
- if (check(thd, &check_opt))
- {
- sql_print_error("Warning: Recovering table: '%s'",table->path);
- check_opt.flags=
- ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
- (marked_crashed ? 0 : T_QUICK) |
- (myisam_recover_options & HA_RECOVER_FORCE ? 0 : T_SAFE_REPAIR) |
- T_AUTO_REPAIR);
- if (repair(thd, &check_opt))
- error=1;
- }
- pthread_mutex_lock(&LOCK_thread_count);
- thd->query= old_query;
- thd->query_length= old_query_length;
- pthread_mutex_unlock(&LOCK_thread_count);
+ sql_print_error("Warning: Recovering table: '%s'",table->path);
+ check_opt.flags=
+ ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
+ (marked_crashed ? 0 : T_QUICK) |
+ (myisam_recover_options & HA_RECOVER_FORCE ? 0 : T_SAFE_REPAIR) |
+ T_AUTO_REPAIR);
+ if (repair(thd, &check_opt))
+ error=1;
}
+ pthread_mutex_lock(&LOCK_thread_count);
+ thd->query= old_query;
+ thd->query_length= old_query_length;
+ pthread_mutex_unlock(&LOCK_thread_count);
DBUG_RETURN(error);
}