Porting bugfix made by Serg (for bug37276_reduced_corruption.sql of BUG#37276 "Maria: various index corruption,

block format assertion failure") from 6.0-maria to 5.1-maria.
This commit is contained in:
Guilhem Bichot 2008-07-10 16:51:59 +02:00
parent eb548dc32f
commit dddc6fd2ef
3 changed files with 80 additions and 5 deletions

View file

@ -1865,3 +1865,38 @@ t1 CREATE TABLE `t1` (
KEY `b` (`b`) KEY_BLOCK_SIZE=8192
) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=16384
drop table t1;
create table t2(a varchar(255),key(a))engine=maria row_format=dynamic transactional=0;
insert into t2 values (repeat('o',124)), (repeat('h',226)), (repeat('i',236)),
(repeat('l',234)), (repeat('b',13)), (repeat('g',236)), (repeat('y',205)),
(repeat('c',99)), (repeat('g',145)), (repeat('o',131)), (repeat('e',63)),
(repeat('q',155)), (repeat('k',87)), (repeat('i',54)), (repeat('p',84)),
(repeat('m',119)), (repeat('c',2)), (repeat('a',174)), (repeat('g',160)),
(repeat('t',147)), (repeat('n',107));
insert into t2 values ('nupdjlafwfvuuvruxkyjxpmupihzgspkaybijztkeukgzzkrxmd');
insert into t2 values (repeat('g',40)), (repeat('i',173)), (repeat('q',126)),
(repeat('i',217)), (repeat('f',161)), (repeat('i',28)), (repeat('a',35)),
(repeat('y',27)), (repeat('o',100)), (repeat('o',175)), (repeat('f',69)),
(repeat('k',156)), (repeat('n',220)), (repeat('q',247)), (repeat('y',180)),
(repeat('v',209)), (repeat('m',169)), (repeat('y',170)), (repeat('r',151)),
(repeat('d',38)), (repeat('g',64)), (repeat('k',77)), (repeat('l',150)),
(repeat('s',150)), (repeat('u',127)), (repeat('l',15)), (repeat('m',33)),
(repeat('r',177)), (repeat('v',197)), (repeat('k',62)), (repeat('h',219)),
(repeat('u',161)), (repeat('y',118)), (repeat('i',184)), (repeat('z',202)),
(repeat('j',113)), (repeat('q',95)), (repeat('q',164)), (repeat('e',54)),
(repeat('e',60)), (repeat('l',203)), (repeat('g',77)), (repeat('y',44)),
(repeat('j',196)), (repeat('t',45)), (repeat('l',190)), (repeat('l',89)),
(repeat('q',45)), (repeat('e',191)), (repeat('t',38)), (repeat('f',148)),
(repeat('c',25)), (repeat('v',97)), (repeat('i',83)), (repeat('s',166)),
(repeat('d',96)), (repeat('v',82)), (repeat('n',127)), (repeat('i',201)),
(repeat('x',184)), (repeat('d',76)), (repeat('u',17)), (repeat('a',178));
insert into t2 values ('hwvfiavnmufgbulapzrolonwxufheqymvjncnczlzcjokzqlsvmomcjzgzwzquyxpunxdmotdczocwliaprpubwaeccsulvittgizcutxxb');
insert into t2 values (repeat('x',28)), (repeat('p',21)), (repeat('k',241)),
(repeat('i',243)), (repeat('b',172)), (repeat('z',94)), (repeat('i',218)),
(repeat('a',177)), (repeat('g',251)), (repeat('q',161)), (repeat('x',231)),
(repeat('p',51)), (repeat('f',141)), (repeat('m',28)), (repeat('r',77)),
(repeat('h',56)), (repeat('k',23)), (repeat('f',198)), (repeat('o',243)),
(repeat('d',160)), (repeat('h',82));
check table t2 extended;
Table Op Msg_type Msg_text
test.t2 check status OK
drop table t2;

View file

@ -1148,8 +1148,47 @@ create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_
show create table t1;
drop table t1;
#
# from bug37276_reduced_corruption.sql
#
create table t2(a varchar(255),key(a))engine=maria row_format=dynamic transactional=0;
insert into t2 values (repeat('o',124)), (repeat('h',226)), (repeat('i',236)),
(repeat('l',234)), (repeat('b',13)), (repeat('g',236)), (repeat('y',205)),
(repeat('c',99)), (repeat('g',145)), (repeat('o',131)), (repeat('e',63)),
(repeat('q',155)), (repeat('k',87)), (repeat('i',54)), (repeat('p',84)),
(repeat('m',119)), (repeat('c',2)), (repeat('a',174)), (repeat('g',160)),
(repeat('t',147)), (repeat('n',107));
insert into t2 values ('nupdjlafwfvuuvruxkyjxpmupihzgspkaybijztkeukgzzkrxmd');
insert into t2 values (repeat('g',40)), (repeat('i',173)), (repeat('q',126)),
(repeat('i',217)), (repeat('f',161)), (repeat('i',28)), (repeat('a',35)),
(repeat('y',27)), (repeat('o',100)), (repeat('o',175)), (repeat('f',69)),
(repeat('k',156)), (repeat('n',220)), (repeat('q',247)), (repeat('y',180)),
(repeat('v',209)), (repeat('m',169)), (repeat('y',170)), (repeat('r',151)),
(repeat('d',38)), (repeat('g',64)), (repeat('k',77)), (repeat('l',150)),
(repeat('s',150)), (repeat('u',127)), (repeat('l',15)), (repeat('m',33)),
(repeat('r',177)), (repeat('v',197)), (repeat('k',62)), (repeat('h',219)),
(repeat('u',161)), (repeat('y',118)), (repeat('i',184)), (repeat('z',202)),
(repeat('j',113)), (repeat('q',95)), (repeat('q',164)), (repeat('e',54)),
(repeat('e',60)), (repeat('l',203)), (repeat('g',77)), (repeat('y',44)),
(repeat('j',196)), (repeat('t',45)), (repeat('l',190)), (repeat('l',89)),
(repeat('q',45)), (repeat('e',191)), (repeat('t',38)), (repeat('f',148)),
(repeat('c',25)), (repeat('v',97)), (repeat('i',83)), (repeat('s',166)),
(repeat('d',96)), (repeat('v',82)), (repeat('n',127)), (repeat('i',201)),
(repeat('x',184)), (repeat('d',76)), (repeat('u',17)), (repeat('a',178));
insert into t2 values ('hwvfiavnmufgbulapzrolonwxufheqymvjncnczlzcjokzqlsvmomcjzgzwzquyxpunxdmotdczocwliaprpubwaeccsulvittgizcutxxb');
insert into t2 values (repeat('x',28)), (repeat('p',21)), (repeat('k',241)),
(repeat('i',243)), (repeat('b',172)), (repeat('z',94)), (repeat('i',218)),
(repeat('a',177)), (repeat('g',251)), (repeat('q',161)), (repeat('x',231)),
(repeat('p',51)), (repeat('f',141)), (repeat('m',28)), (repeat('r',77)),
(repeat('h',56)), (repeat('k',23)), (repeat('f',198)), (repeat('o',243)),
(repeat('d',160)), (repeat('h',82));
check table t2 extended;
drop table t2;
--disable_result_log
--disable_query_log
eval set global storage_engine=$default_engine, maria_page_checksum=$default_checksum;
--enable_result_log
--enable_query_log

View file

@ -814,6 +814,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
MARIA_SHARE *share= info->s;
char llbuff[22];
uint diff_pos[2];
uchar tmp_key_buff[MARIA_MAX_KEY_BUFF];
MARIA_KEY tmp_key;
DBUG_ENTER("chk_index");
DBUG_DUMP("buff", buff, _ma_get_page_used(share, buff));
@ -860,7 +861,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
"Page at %s is marked with HAS_TRANSID even if "
"table is not transactional",
llstr(page, llbuff));
}
}
if (used_length > (uint) keyinfo->block_length - KEYPAGE_CHECKSUM_SIZE)
{
@ -870,7 +871,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
}
info->last_key.keyinfo= tmp_key.keyinfo= keyinfo;
tmp_key.data= info->lastkey_buff2;
tmp_key.data= tmp_key_buff;
for ( ;; )
{
if (*_ma_killed_ptr(param))
@ -908,7 +909,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
llstr(page,llbuff));
goto err;
}
if ((*keys)++ &&
(flag=ha_key_cmp(keyinfo->seg, info->last_key.data, tmp_key.data,
tmp_key.data_length + tmp_key.ref_length,
@ -933,7 +934,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
if (*keys != 1L) /* not first_key */
{
if (param->stats_method == MI_STATS_METHOD_NULLS_NOT_EQUAL)
ha_key_cmp(keyinfo->seg, (uchar*) info->last_key.data,
ha_key_cmp(keyinfo->seg, (uchar*) info->last_key.data,
tmp_key.data, tmp_key.data_length,
SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL,
diff_pos);
@ -1107,7 +1108,7 @@ static int check_keys_in_record(HA_CHECK *param, MARIA_HA *info, int extend,
printf("%s\r", llstr(param->records, llbuff));
VOID(fflush(stdout));
}
/* Check if keys match the record */
for (keynr=0, keyinfo= share->keyinfo; keynr < share->base.keys;
keynr++, keyinfo++)