Bug #29445 match ... against () never returns
Submitted: 29 Jun 2007 13:47 Modified: 23 Jul 2007 1:13
Reporter: Sergei Golubchik Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: FULLTEXT search Severity:S3 (Non-critical)
Version:5.1 OS:Linux
Assigned to: Sergey Vojtovich CPU Architecture:Any

[29 Jun 2007 13:47] Sergei Golubchik
Description:
See how to repeat.
This does never return, and the best thing I have figured out to do is
kill-9 mysql.

This happens on a Red Hat system (I can get you more info if you require
it). Server appears to be 5.1.16-beta.

How to repeat:
DROP TABLE IF EXISTS `movies`;
CREATE TABLE `movies` (
  `movie_id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL,
  PRIMARY KEY (`movie_id`),
  FULLTEXT KEY `title` (`title`)
) ENGINE=MyISAM AUTO_INCREMENT=154 DEFAULT CHARSET=utf8;

INSERT INTO `movies` VALUES (111,'Offside'),(142,'City Of God');

select count(movie_id) as cnt from movies where match (movies.title)
against ('+city of*' in boolean mode);
[10 Jul 2007 11:34] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/30594

ChangeSet@1.2538, 2007-07-10 15:37:39+05:00, svoj@mysql.com +3 -0
  BUG#29445 - match ... against () never returns
  
  Part 1:
  Do not perform index search for a plus-word with truncation operator
  in case there are other plus-words in expression.
  
  Specifically this optimization was enforced for expression like
  "+word1 +word2*", but wasn't enforced for expression like
  "+word1 word2*".
[10 Jul 2007 16:47] Sergei Golubchik
part 1 is ok to push
the status is back to "in progress", waiting for a "part 2" patch.
[12 Jul 2007 12:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/30771

ChangeSet@1.2544, 2007-07-12 16:43:19+05:00, svoj@mysql.com +3 -0
  BUG#29445 - match ... against () never returns
  
  Part 2:
  Searching fulltext index for a word with boolean mode truncation
  operator may cause infinite loop.
  
  The problem was that "smarter index merge" was used with "trunc-words",
  which must never happen.
  
  Affects 5.1 only.
[12 Jul 2007 18:35] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/30827

ChangeSet@1.2544, 2007-07-13 03:25:27+05:00, svoj@mysql.com +3 -0
  BUG#29445 - match ... against () never returns
  
  Part 2:
  Searching fulltext index for a word with boolean mode truncation
  operator may cause infinite loop.
  
  The problem was that "smarter index merge" was used with "trunc-words",
  which must never happen.
  
  Affects 5.1 only.
[17 Jul 2007 15:30] Bugs System
Pushed into 5.1.21-beta
[23 Jul 2007 1:13] Paul DuBois
Noted in 5.1.21 changelog.

Searching a FULLTEXT index for a word with the boolean mode
truncation operator could cause an infinite loop.