From 589ac1cfdcb44818caff300777223eac723dd762 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 28 Nov 2008 18:17:13 +0400 Subject: BUG#37245 - Full text search problem Certain boolean mode queries with truncation operator did not return matching records and calculate relevancy incorrectly. myisam/ft_boolean_search.c: Sort ftb->list in ascending order. This helps to fix binary search in ft_boolean_find_relevance() without rewriting it much. Fixed binary search in ft_boolean_find_relevance(), so it finds right-most element in an array. Fixed that ft_boolean_find_relevance() didn't return match for words with truncation operator in case query has other non- matching words. mysql-test/r/fulltext.result: A test case for BUG#37245. mysql-test/t/fulltext.test: A test case for BUG#37245. --- mysql-test/r/fulltext.result | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/r/fulltext.result') diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index e73f8af405c..6821691c9d0 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -497,3 +497,12 @@ WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref b b 5 const 4 Using where DROP TABLE t1; +CREATE TABLE t1(a CHAR(10)); +INSERT INTO t1 VALUES('aaa15'); +SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1; +MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) +1 +SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1; +MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) +2 +DROP TABLE t1; -- cgit v1.2.1