Bug #18071 Result from MATCH() uses too many decimals
Submitted: 8 Mar 2006 14:32 Modified: 10 Apr 2006 20:04
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.20 OS:Microsoft Windows (Windows, Linux)
Assigned to: Magnus Blåudd CPU Architecture:Any

[8 Mar 2006 14:32] Magnus Blåudd
Description:
fulltext                       [ fail ]

Errors are (from C:/cygwin/home/mysqldev/pb/mysql-5.0/push-anozdrin@mysql.com-20060307221413.info/mysql-5.0.20-standard/mysql-test/var-n_stm-5/log/mysqltest-time) :
mysqltest: Result content mismatch
(the last lines may be the most important ones)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** r/fulltext.result	2006-03-07 22:22:29 +03:00
--- r/fulltext.reject	2006-03-07 23:07:04 +03:00
***************
*** 450,458 ****
  PREPARE stmt from "SELECT a, MATCH(a) AGAINST('test1 test') FROM t1 WHERE MATCH(a) AGAINST('test1 test')";
  EXECUTE stmt;
  a	MATCH(a) AGAINST('test1 test')
! test1	0.68526661396027
  EXECUTE stmt;
  a	MATCH(a) AGAINST('test1 test')
! test1	0.68526661396027
  DEALLOCATE PREPARE stmt;
  DROP TABLE t1;
--- 450,458 ----
  PREPARE stmt from "SELECT a, MATCH(a) AGAINST('test1 test') FROM t1 WHERE MATCH(a) AGAINST('test1 test')";
  EXECUTE stmt;
  a	MATCH(a) AGAINST('test1 test')
! test1	0.68526663197496
  EXECUTE stmt;
  a	MATCH(a) AGAINST('test1 test')
! test1	0.68526663197496
  DEALLOCATE PREPARE stmt;
  DROP TABLE t1;
-------------------------------------------------------
Please follow the instructions outlined at
http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html
to find the reason to this problem and how to report this.

How to repeat:
Run "./mysql-test-run.pl fulltext" on a windows machine.

The value returned from MATCH is returned as a real with macimum number of decimals. But in the code only a float is used to return the match value from 'ft_boolean_find_relevance' and 'ft_nlq_find_relevance'

Suggested fix:

Limit the number of decimals used when returning the match value to FLT_DIG, which normally is "6".
[8 Mar 2006 22:22] 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/3601
[9 Mar 2006 12:07] Magnus Blåudd
Asked Wax to review.
[10 Mar 2006 12:12] 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/3698
[22 Mar 2006 14:04] 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/4019
[10 Apr 2006 20:04] Paul DuBois
No changelog entry needed.