Bug #27170 fulltext score problem in boolean mode
Submitted: 15 Mar 2007 12:01 Modified: 29 Apr 2007 6:28
Reporter: gundars mateus Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: FULLTEXT search Severity:S3 (Non-critical)
Version:5.0.24a OS:Linux (Linux 2.4.31-ow1 #1 Debian)
Assigned to: CPU Architecture:Any
Tags: fulltext score boolean mode order

[15 Mar 2007 12:01] gundars mateus
Description:
I think I've found a pretty interesting bug, FULLTEXT users should be aware
of.

Consider this simple select:
----------------------------------------------------------------------------
 SELECT id, price,
  MATCH(`fulltext`) AGAINST (' hp* l1955* '   IN BOOLEAN MODE) score1,
  MATCH(`fulltext`) AGAINST (' hp* l1955* '   IN BOOLEAN MODE) score2
 FROM products as p
 WHERE MATCH(`fulltext`) AGAINST ('hp* l1955*' IN BOOLEAN MODE)
 ORDER BY score1 DESC ,price ASC
----------------------------------------------------------------------------
The problem is with `score1` and `score2`, SOMETIMES THESE TWO ARE NOT
EQUAL(this is happening very rarely and only in the first row of the
recordset)!

The problem goes away after removing [,price ASC ] from the ORDER clause

Normaly there should be only one score field, but sometimes it has
incorrect value. The second score2 field is allways correct.

What's interesting is that when score1 value is incorrect ordering by score1 is done correctly, so it tells us that internally the value is ok, but somehow get's wrongly displayed.

my server version: 5.0.24a-Debian_2.dotdeb.0-log

How to repeat:
It is hard to reproduce this bug. Just get any fulltext indexed table and try to do ordering like in the example: first order by score DESC and then by any other field ASC.

Try to use data I have, it is provided below. If it doesn't help do many thousands of selects until score1 != score2

So far I have found 2 records which are allways having this problem, even after recreating the table. 

-----------------
1)
-----------------
fulltext field data: "NEC 90GX2 Datori >>> Monitori >>> LCD"

... MATCH(`fulltext`) AGAINST (' nec* 90gx2* '   IN BOOLEAN MODE)

-----------------
2)
-----------------
fulltext field data: "HP L1955 (19") LCD monitors Datoru monitori >>> LCD MONITORI >>> HEWLETT-PACKARD"

...MATCH(`fulltext`) AGAINST (' hp* l1955* '   IN BOOLEAN MODE)
[29 Mar 2007 6:28] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.0.37, and inform about the results.
[29 Apr 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".