sql-bench/server-cfg.sh:
  Auto merged
Docs/manual.texi:
  Merged of manual
This commit is contained in:
unknown 2000-08-17 01:20:21 +03:00
commit c4543517a3
13 changed files with 150 additions and 73 deletions

View file

@ -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))
{

View file

@ -27,6 +27,7 @@
// the following is for checking tables
#define HA_CHECK_ALREADY_CHECKED 1
#define HA_CHECK_OK 0
#define HA_CHECK_NOT_IMPLEMENTED -1
#define HA_CHECK_CORRUPT -2

View file

@ -78,6 +78,7 @@ static SYMBOL symbols[] = {
{ "CHAR", SYM(CHAR_SYM),0,0},
{ "CHARACTER", SYM(CHAR_SYM),0,0},
{ "CHANGE", SYM(CHANGE),0,0},
{ "CHANGED", SYM(CHANGED),0,0},
{ "CHECK", SYM(CHECK_SYM),0,0},
{ "CHECKSUM", SYM(CHECKSUM_SYM),0,0},
{ "COLLECTION", SYM(COLLECTION),0,0},
@ -124,6 +125,7 @@ static SYMBOL symbols[] = {
{ "EXPLAIN", SYM(DESCRIBE),0,0},
{ "EXISTS", SYM(EXISTS),0,0},
{ "EXTENDED", SYM(EXTENDED_SYM),0,0},
{ "FAST", SYM(FAST_SYM),0,0},
{ "FIELDS", SYM(COLUMNS),0,0},
{ "FILE", SYM(FILE_SYM),0,0},
{ "FIRST", SYM(FIRST_SYM),0,0},

View file

@ -224,7 +224,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
else
error=read_sep_field(thd,info,table,fields,read_info,*enclosed);
if (table->file->extra(HA_EXTRA_NO_CACHE) ||
table->file->activate_all_index((ha_rows) 0))
table->file->activate_all_index(thd))
error=1; /* purecov: inspected */
table->time_stamp=save_time_stamp;

View file

@ -954,6 +954,11 @@ int mysql_check_table(THD* thd, TABLE_LIST* tables,HA_CHECK_OPT* check_opt)
net_store_data(packet, "OK");
break;
case HA_CHECK_ALREADY_CHECKED:
net_store_data(packet, "status");
net_store_data(packet, "Not checked");
break;
case HA_CHECK_CORRUPT:
net_store_data(packet, "status");
net_store_data(packet, "Corrupt");

View file

@ -276,12 +276,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token BIGINT
%token BLOB_SYM
%token CHAR_SYM
%token CHANGED
%token COALESCE
%token DATETIME
%token DATE_SYM
%token DECIMAL_SYM
%token DOUBLE_SYM
%token ENUM
%token FAST_SYM
%token FLOAT_SYM
%token INT_SYM
%token LIMIT
@ -1104,8 +1106,10 @@ opt_mi_check_type:
| TYPE_SYM EQ mi_check_types {}
mi_check_types:
QUICK { Lex->check_opt.quick = 1; }
| EXTENDED_SYM { Lex->check_opt.flags = T_EXTEND; }
QUICK { Lex->check_opt.quick = 1; }
| FAST_SYM { Lex->check_opt.flags|= T_FAST; }
| EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
| CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; }
analyze:
ANALYZE_SYM table_or_tables table_list
@ -2332,6 +2336,7 @@ keyword:
| BEGIN_SYM {}
| BIT_SYM {}
| BOOL_SYM {}
| CHANGED {}
| CHECKSUM_SYM {}
| CHECK_SYM {}
| COMMENT_SYM {}
@ -2348,6 +2353,7 @@ keyword:
| ENUM {}
| ESCAPE_SYM {}
| EXTENDED_SYM {}
| FAST_SYM {}
| FILE_SYM {}
| FIRST_SYM {}
| FIXED_SYM {}
@ -2383,6 +2389,7 @@ keyword:
| PASSWORD {}
| PROCESS {}
| PROCESSLIST_SYM {}
| QUICK {}
| RAID_0_SYM {}
| RAID_CHUNKS {}
| RAID_CHUNKSIZE {}

View file

@ -71,7 +71,7 @@ typedef struct st_key {
char *name; /* Name of key */
ulong *rec_per_key; /* Key part distribution */
union {
uint bdb_return_if_eq;
int bdb_return_if_eq;
} handler;
} KEY;