Bug #3699 Matching against a quoted string can give wrong results
Submitted: 10 May 2004 10:16 Modified: 10 May 2004 12:24
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:MySQL 4.0.15-standard-log OS:Linux (Suse 7.3 (Linux kernal 2.4.18))
Assigned to: Sergei Golubchik CPU Architecture:Any

[10 May 2004 10:16] [ name withheld ]
Description:
Matching against a quoted string can give wrong results if the first word (within the quotes) is to short (probably when word ist shorter than ft_min_word_len).

How to repeat:
When using the following table:
  CREATE TABLE `test` (
    `id` int(11) NOT NULL auto_increment,
    `content` text NOT NULL,
    PRIMARY KEY  (`id`),
    FULLTEXT KEY `content` (`content`)
  ) TYPE=MyISAM;

with the following data:
  INSERT INTO `test` VALUES (1, '... es existiert kein Grund, warum die Polizei diesen ...');

you can use the following selects to repeat the problem:
  SELECT id, content FROM test WHERE MATCH (content) AGAINST ("\"istiert kein Grund\"" IN BOOLEAN MODE)

  SELECT id, content FROM test WHERE MATCH (content) AGAINST ("\"um die polizei\"" IN BOOLEAN MODE)

The first select will return no results (as expected).
The second select should have the same behaviour ... But since
the first word ("um") is to short, mySQL give a result (and it should not!)

Suggested fix:
?
[10 May 2004 12:24] Sergei Golubchik
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

It's fixed already in 4.1 tree, but I backported the fix to 4.0 too.