mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Fix hang/crash with Boolean full-text search against an unindexed field for
which the query contained more words than we allocated space. (Bug #7858)
This commit is contained in:
parent
9b3d0b85a3
commit
176143413e
3 changed files with 4 additions and 4 deletions
|
|
@ -398,7 +398,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
|
||||||
Hack: instead of init_queue, we'll use reinit queue to be able
|
Hack: instead of init_queue, we'll use reinit queue to be able
|
||||||
to alloc queue with alloc_root()
|
to alloc queue with alloc_root()
|
||||||
*/
|
*/
|
||||||
res=ftb->queue.max_elements=1+query_len/(min(ft_min_word_len,2)+1);
|
res=ftb->queue.max_elements=1+query_len/2;
|
||||||
if (!(ftb->queue.root=
|
if (!(ftb->queue.root=
|
||||||
(byte **)alloc_root(&ftb->mem_root, (res+1)*sizeof(void*))))
|
(byte **)alloc_root(&ftb->mem_root, (res+1)*sizeof(void*))))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ insert into t2 values (3, 1, 'xxbuz');
|
||||||
select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('xxfoo' in boolean mode);
|
select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('xxfoo' in boolean mode);
|
||||||
t1_id name t2_id t1_id name
|
t1_id name t2_id t1_id name
|
||||||
1 data1 1 1 xxfoo
|
1 data1 1 1 xxfoo
|
||||||
select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode);
|
select * from t2 where match name against ('*a*b*c*d*e*f*' in boolean mode);
|
||||||
t2_id t1_id name
|
t2_id t1_id name
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
create table t1 (a text, fulltext key (a));
|
create table t1 (a text, fulltext key (a));
|
||||||
|
|
|
||||||
|
|
@ -253,9 +253,9 @@ insert into t2 values (3, 1, 'xxbuz');
|
||||||
select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('xxfoo' in boolean mode);
|
select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('xxfoo' in boolean mode);
|
||||||
|
|
||||||
#
|
#
|
||||||
# bug with many short (< ft_min_word_len) words in boolean search
|
# Bug #7858: bug with many short (< ft_min_word_len) words in boolean search
|
||||||
#
|
#
|
||||||
select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode);
|
select * from t2 where match name against ('*a*b*c*d*e*f*' in boolean mode);
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue