fulltext boolean: ORDER BY makes relevance change
am 13.09.2002 16:02:59 von Julian Ladisch>Description:
The relevance of the string "table ignore" when matching against
('t* f*' IN BOOLEAN MODE) is 2. This correct result is returned by
SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel
FROM t1;
However, if another entry with the string "table" exists and you add
"ORDER BY rel,a" to the query, the result for the relevance of
"table ignore" is 1, which is wrong, because ORDER BY must not change
the result.
I found this bug in the source distributions of both mysql-4.0.1-alpha
and mysql-4.0.3-beta.
Testfile fulltext_order_by.test can easily be extended to use my test
below.
>How-To-Repeat:
use test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
message CHAR(20),
FULLTEXT(message)
);
INSERT INTO t1 (message) VALUES ("testbug"),("testbug foobar");
SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel
FROM t1;
SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel
FROM t1 ORDER BY rel,a;
drop table t1;
>Originator: Julian Ladisch
>MySQL support: licence
>Synopsis: fulltext boolean: ORDER BY makes relevance change
>Severity: non-critical
>Priority: low
>Category: mysql
>Class: sw-bug
>Release: mysql-4.0.3-beta (Source distribution)
>Environment:
System: Linux 2.4.10-4GB #1 Tue Sep 25 12:33:54 GMT 2001 i686 unknown
Architecture: i686
Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc
/usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.3/specs
gcc version 2.95.3 20010315 (SuSE)
Compilation info: CC='gcc' CFLAGS='-O3' CXX='gcc' CXXFLAGS='-O3
-felide-constructors -fno-exceptions -fno-rtti' LDFLAGS=''
LIBC:
-rwxr-xr-x 1 root root 1384168 Sep 20 2001 /lib/libc.so.6
-rw-r--r-- 1 root root 25215580 Sep 20 2001 /usr/lib/libc.a
-rw-r--r-- 1 root root 178 Sep 20 2001 /usr/lib/libc.so
-rw-r--r-- 1 root root 856542 Sep 24 2001 /usr/lib/libc-client.a
lrwxrwxrwx 1 root root 20 Jan 31 2002 /usr/lib/libc-client.so -> libc-client.so.2000c
-rwxr-xr-x 1 root root 718160 Sep 24 2001 /usr/lib/libc-client.so.2000c
Configure command: ./configure --prefix=/usr/local/mysql
--enable-assembler --with-mysqld-ldflags=-all-static CFLAGS=-O3
'CXXFLAGS=-O3 -felide-constructors -fno-exceptions -fno-rtti' CXX=gcc
------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail bugs-thread12541@lists.mysql.com
To unsubscribe, e-mail