Commit 36c7d4eb authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

Merge

parents 10693572 ef379c0d
a rel
1 0
2 0
3 0
5 0
6 0
7 0.89568988462614
4 0.90587321329654
a MATCH b AGAINST ('lala lkjh')
1 0.67003110026735
2 0
3 0
a MATCH c AGAINST ('lala lkjh')
1 0
2 0.67756324121582
3 0
a MATCH b,c AGAINST ('lala lkjh')
1 0.64840710366884
2 0.66266459031789
3 0
...@@ -4,10 +4,16 @@ CREATE TABLE test ( ...@@ -4,10 +4,16 @@ CREATE TABLE test (
a INT AUTO_INCREMENT PRIMARY KEY, a INT AUTO_INCREMENT PRIMARY KEY,
message CHAR(20), message CHAR(20),
FULLTEXT(message) FULLTEXT(message)
) comment = 'testcase by sroussey@network54.com'; ) comment = 'original testcase by sroussey@network54.com';
INSERT INTO test (message) VALUES ("Testing"),("table"),("testbug"), INSERT INTO test (message) VALUES ("Testing"),("table"),("testbug"),
("steve"),("is"),("cool"),("steve is cool"); ("steve"),("is"),("cool"),("steve is cool");
# basic MATCH
@r/ft0000001.a.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE MATCH (message) AGAINST ('steve'); @r/ft0000001.a.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE MATCH (message) AGAINST ('steve');
@r/ft0000001.b.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE MATCH (message) AGAINST ('steve') ORDER BY a; # MATCH + ORDER BY (w/o ft-ranges)
@r/ft0000001.b.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE MATCH (message) AGAINST ('steve') +0 ORDER BY a;
# MATCH + ORDER BY (w/ ft-ranges) + UNIQUE
@r/ft0000001.c.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; @r/ft0000001.c.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
# MATCH + ORDER BY + UNIQUE (const_table)
@r/ft0000001.d.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; @r/ft0000001.d.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
# ORDER BY MATCH
@r/ft0000001.e.result SELECT a, MATCH (message) AGAINST ('steve') as rel FROM test ORDER BY rel;
# several FULLTEXT indexes in one table test
use test;
DROP TABLE IF EXISTS test;
CREATE TABLE test (
a int(11) NOT NULL auto_increment,
b text,
c varchar(254) default NULL,
PRIMARY KEY (a),
FULLTEXT KEY bb(b),
FULLTEXT KEY cc(c),
FULLTEXT KEY a(b,c)
);
INSERT INTO test VALUES (1,'lala lolo lili','oooo aaaa pppp');
INSERT INTO test VALUES (2,'asdf fdsa','lkjh fghj');
INSERT INTO test VALUES (3,'qpwoei','zmxnvb');
@r/ft0000002.a.result SELECT a, MATCH b AGAINST ('lala lkjh') FROM test;
@r/ft0000002.b.result SELECT a, MATCH c AGAINST ('lala lkjh') FROM test;
@r/ft0000002.c.result SELECT a, MATCH b,c AGAINST ('lala lkjh') FROM test;
...@@ -301,6 +301,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, ...@@ -301,6 +301,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
volatile bool *killed= &current_thd->killed; volatile bool *killed= &current_thd->killed;
handler *file; handler *file;
DBUG_ENTER("find_all_keys"); DBUG_ENTER("find_all_keys");
DBUG_PRINT("info",("using: %s",(select?select->quick?"ranges":"where":"every row")));
idx=indexpos=0; idx=indexpos=0;
error=quick_select=0; error=quick_select=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment