MDEV-9137 MariaDB Crash on Query Using Aria Engine

fix for 2-level ft indexes and boolean search in Aria
This commit is contained in:
Sergei Golubchik 2018-09-05 01:34:25 +02:00
parent 7438667fa9
commit fb324e3f8f
3 changed files with 6 additions and 1 deletions

View File

@ -18,5 +18,8 @@ test.t1 check status OK
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
count(*)
1024
insert t1 (a) values ('aaaxxx'),('aaayyy');
drop table t1;

View File

@ -39,6 +39,8 @@ repair table t1;
check table t1;
repair table t1;
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
# mi_write:
insert t1 (a) values ('aaaxxx'),('aaayyy');

View File

@ -457,7 +457,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
*/
ftbw->off=off;
ftbw->key_root= info->cur_row.lastpos;
ftbw->keyinfo=& info->s->ft2_keyinfo;
ftbw->keyinfo= info->last_key.keyinfo= & info->s->ft2_keyinfo;
r= _ma_search_first(info, ftbw->keyinfo, ftbw->key_root);
DBUG_ASSERT(r==0); /* found something */
memcpy(lastkey_buf+off, info->last_key.data,