Merge fix for BUG47073.
This commit is contained in:
commit
f1c2f6e84e
@ -2271,4 +2271,32 @@ checksum table t3;
|
||||
Table Checksum
|
||||
test.t3 326284887
|
||||
drop table t1,t2,t3;
|
||||
CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b));
|
||||
INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'),
|
||||
(6,'0'),(7,'0');
|
||||
INSERT INTO t1 SELECT a+10,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+20,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+40,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+80,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+160,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+320,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+640,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+1280,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+2560,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+5120,b FROM t1;
|
||||
SET myisam_sort_buffer_size=4;
|
||||
REPAIR TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair error myisam_sort_buffer_size is too small
|
||||
test.t1 repair warning Number of rows changed from 0 to 7168
|
||||
test.t1 repair status OK
|
||||
SET myisam_repair_threads=2;
|
||||
REPAIR TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair error myisam_sort_buffer_size is too small
|
||||
test.t1 repair warning Number of rows changed from # to 7168
|
||||
test.t1 repair status OK
|
||||
SET myisam_repair_threads=@@global.myisam_repair_threads;
|
||||
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -1518,5 +1518,33 @@ CREATE TABLE t3 select * from t1;
|
||||
checksum table t3;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
|
||||
#
|
||||
# BUG#47073 - valgrind errs, corruption,failed repair of partition,
|
||||
# low myisam_sort_buffer_size
|
||||
#
|
||||
CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b));
|
||||
INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'),
|
||||
(6,'0'),(7,'0');
|
||||
INSERT INTO t1 SELECT a+10,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+20,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+40,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+80,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+160,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+320,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+640,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+1280,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+2560,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+5120,b FROM t1;
|
||||
SET myisam_sort_buffer_size=4;
|
||||
REPAIR TABLE t1;
|
||||
SET myisam_repair_threads=2;
|
||||
# May report different values depending on threads activity.
|
||||
--replace_regex /changed from [0-9]+/changed from #/
|
||||
REPAIR TABLE t1;
|
||||
SET myisam_repair_threads=@@global.myisam_repair_threads;
|
||||
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
@ -1087,22 +1087,6 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize)
|
||||
ha_rows rows= file->state->records;
|
||||
DBUG_ENTER("ha_myisam::repair");
|
||||
|
||||
/*
|
||||
Normally this method is entered with a properly opened table. If the
|
||||
repair fails, it can be repeated with more elaborate options. Under
|
||||
special circumstances it can happen that a repair fails so that it
|
||||
closed the data file and cannot re-open it. In this case file->dfile
|
||||
is set to -1. We must not try another repair without an open data
|
||||
file. (Bug #25289)
|
||||
*/
|
||||
if (file->dfile == -1)
|
||||
{
|
||||
sql_print_information("Retrying repair of: '%s' failed. "
|
||||
"Please try REPAIR EXTENDED or myisamchk",
|
||||
table->s->path.str);
|
||||
DBUG_RETURN(HA_ADMIN_FAILED);
|
||||
}
|
||||
|
||||
param.db_name= table->s->db.str;
|
||||
param.table_name= table->alias;
|
||||
param.tmpfile_createflag = O_RDWR | O_TRUNC;
|
||||
|
@ -2561,8 +2561,9 @@ err:
|
||||
VOID(my_close(new_file,MYF(0)));
|
||||
VOID(my_raid_delete(param->temp_filename,share->base.raid_chunks,
|
||||
MYF(MY_WME)));
|
||||
if (info->dfile == new_file)
|
||||
info->dfile= -1;
|
||||
if (info->dfile == new_file) /* Retry with key cache */
|
||||
if (unlikely(mi_open_datafile(info, share, name, -1)))
|
||||
param->retry_repair= 0; /* Safety */
|
||||
}
|
||||
mi_mark_crashed_on_repair(info);
|
||||
}
|
||||
@ -3095,8 +3096,9 @@ err:
|
||||
VOID(my_close(new_file,MYF(0)));
|
||||
VOID(my_raid_delete(param->temp_filename,share->base.raid_chunks,
|
||||
MYF(MY_WME)));
|
||||
if (info->dfile == new_file)
|
||||
info->dfile= -1;
|
||||
if (info->dfile == new_file) /* Retry with key cache */
|
||||
if (unlikely(mi_open_datafile(info, share, name, -1)))
|
||||
param->retry_repair= 0; /* Safety */
|
||||
}
|
||||
mi_mark_crashed_on_repair(info);
|
||||
}
|
||||
|
@ -788,7 +788,11 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
|
||||
cleanup:
|
||||
close_cached_file(to_file); /* This holds old result */
|
||||
if (to_file == t_file)
|
||||
{
|
||||
*t_file=t_file2; /* Copy result file */
|
||||
t_file->current_pos= &t_file->write_pos;
|
||||
t_file->current_end= &t_file->write_end;
|
||||
}
|
||||
|
||||
DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */
|
||||
} /* merge_many_buff */
|
||||
|
Loading…
x
Reference in New Issue
Block a user