From dac9e51811a6c4cee0a4ab127f4d264d80a07962 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 2 Feb 2010 15:08:49 +0400 Subject: BUG#50351 - ft_min_word_len=2 Causes query to hang Performing fulltext prefix search (a word with truncation operator) may cause a dead-loop. ft_min_word_len value doesn't matter actually. The problem was introduced along with "smarter index merge" optimization. mysql-test/r/fulltext.result: A test case for BUG#50351. mysql-test/t/fulltext.test: A test case for BUG#50351. storage/myisam/ft_boolean_search.c: When going up to first-level tree, we need to restore docid[0], so it informs fulltext index merge not to enter this second-level tree again (avoiding dead-loop). --- mysql-test/r/fulltext.result | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mysql-test/r/fulltext.result') diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 1ef6656e7a4..cebe2ee4746 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -603,4 +603,24 @@ WHERE t3.a=t1.a AND MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE) count(*) 0 DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a VARCHAR(4), FULLTEXT(a)); +INSERT INTO t1 VALUES +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'), +('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('awrd'),('cwrd'), +('awrd'); +SELECT COUNT(*) FROM t1 WHERE MATCH(a) AGAINST("+awrd bwrd* +cwrd*" IN BOOLEAN MODE); +COUNT(*) +0 +DROP TABLE t1; End of 5.1 tests -- cgit v1.2.1