summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-08-17 01:05:02 +0300
committerunknown <monty@donna.mysql.com>2000-08-17 01:05:02 +0300
commit7496ec3173ed1ad87f07ff87058a40e1748ae64c (patch)
treeeff8fc8b2beebf362d7ac8de2cad48821df97d02 /sql/ha_myisam.cc
parente318f3a607f609c28636a9ac29cd67662166f01a (diff)
downloadmariadb-git-7496ec3173ed1ad87f07ff87058a40e1748ae64c.tar.gz
Additions for CHECK table + update of benchmarks
Docs/manual.texi: Updated for 3.23.23 myisam/mi_check.c: Fix for CHECK table sql-bench/bench-init.pl.sh: Fix of benchmarks for PostgreSQL 7.0.2 sql-bench/server-cfg.sh: Fix of benchmarks for PostgreSQL 7.0.2 sql-bench/test-insert.sh: Fix of benchmarks for PostgreSQL 7.0.2 sql-bench/test-select.sh: Fix of benchmarks for PostgreSQL 7.0.2 sql/ha_myisam.cc: Fix for CHECK table sql/handler.h: Fix for CHECK table sql/lex.h: Fix for CHECK table sql/sql_load.cc: Fix bug in delayed keys sql/sql_table.cc: Fix for CHECK table sql/sql_yacc.yy: Fix for CHECK table sql/structs.h: Fix wrong type
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc47
1 files changed, 26 insertions, 21 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 187cf703ce8..9c68d1bb4b6 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -238,38 +238,38 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
param.thd = thd;
param.op_name = (char*)"check";
param.table_name = table->table_name;
- param.testflag = check_opt->flags | T_CHECK | T_SILENT;
- if (check_opt->quick)
- param.testflag |= T_FAST;
+ param.testflag = check_opt->flags | T_CHECK | T_SILENT | T_MEDIUM;
if (!(table->db_stat & HA_READ_ONLY))
param.testflag|= T_STATISTICS;
param.using_global_keycache = 1;
+ if (!mi_is_crashed(file) &&
+ (((param.testflag & T_CHECK_ONLY_CHANGED) &&
+ !share->state.changed && share->state.open_count == 0) ||
+ ((param.testflag & T_FAST) && share->state.open_count == 0)))
+ return HA_CHECK_ALREADY_CHECKED;
+
error = chk_size(&param, file);
- if (!((param.testflag & T_FAST) && share->state.open_count == 1 &&
- !share->state.changed))
+ if (!error)
+ error |= chk_del(&param, file, param.testflag);
+ if (!error)
+ error = chk_key(&param, file);
+ if (!error)
{
- if (!error)
- error |= chk_del(&param, file, param.testflag);
- if (!error)
- error = chk_key(&param, file);
- if (!error)
+ if (!check_opt->quick &&
+ (share->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)))
{
- if (!(param.testflag & T_FAST) ||
- (share->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)))
- {
- init_io_cache(&param.read_cache, file->dfile,
- my_default_record_cache_size, READ_CACHE,
- share->pack.header_length, 1, MYF(MY_WME));
- error |= chk_data_link(&param, file, param.testflag & T_EXTEND);
- end_io_cache(&(param.read_cache));
- }
+ init_io_cache(&param.read_cache, file->dfile,
+ my_default_record_cache_size, READ_CACHE,
+ share->pack.header_length, 1, MYF(MY_WME));
+ error |= chk_data_link(&param, file, param.testflag & T_EXTEND);
+ end_io_cache(&(param.read_cache));
}
}
if (!error)
{
- if (share->state.changed)
+ if (share->state.changed || (param.testflag & T_STATISTICS))
{
file->update|=HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
pthread_mutex_lock(&share->intern_lock);
@@ -278,11 +278,14 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
#endif
share->state.changed=0;
if (!(table->db_stat & HA_READ_ONLY))
- error=update_state_info(&param,file,UPDATE_TIME | UPDATE_OPEN_COUNT);
+ error=update_state_info(&param,file,UPDATE_TIME | UPDATE_OPEN_COUNT |
+ UPDATE_STAT);
#ifndef HAVE_PREAD
pthread_mutex_unlock(&THR_LOCK_keycache);// QQ; Has to be removed!
#endif
pthread_mutex_unlock(&share->intern_lock);
+ info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE |
+ HA_STATUS_CONST);
}
}
else if (!mi_is_crashed(file))
@@ -379,6 +382,8 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param)
if (file->s->base.auto_key)
update_auto_increment_key(&param, file, 1);
error = update_state_info(&param, file, UPDATE_TIME|UPDATE_STAT);
+ info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE |
+ HA_STATUS_CONST);
}
else if (!mi_is_crashed(file))
{