1
DROP TABLE IF EXISTS t1,t2,t3;
3
a INT AUTO_INCREMENT PRIMARY KEY,
6
) comment = 'original testcase by sroussey@network54.com';
7
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"),
8
("steve"),("is"),("cool"),("steve is cool");
9
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve');
10
a FORMAT(MATCH (message) AGAINST ('steve'),6)
13
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve');
14
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
17
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
18
a FORMAT(MATCH (message) AGAINST ('steve'),6)
21
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
22
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
25
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
26
a FORMAT(MATCH (message) AGAINST ('steve'),6)
29
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a;
30
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
33
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
34
a FORMAT(MATCH (message) AGAINST ('steve'),6)
37
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC;
38
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
41
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
42
a FORMAT(MATCH (message) AGAINST ('steve'),6)
44
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1;
45
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
47
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel;
56
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel;
65
alter table t1 add key m (message);
66
explain SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message;
67
id select_type table type possible_keys key key_len ref rows Extra
68
1 SIMPLE t1 fulltext message message 0 1 Using where; Using filesort
69
SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message desc;
75
a INT AUTO_INCREMENT PRIMARY KEY,
79
INSERT INTO t1 (message) VALUES ("testbug"),("testbug foobar");
80
SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel FROM t1;
84
SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel,a;
90
id int(11) NOT NULL auto_increment,
91
thread int(11) NOT NULL default '0',
92
beitrag longtext NOT NULL,
95
FULLTEXT KEY beitrag (beitrag)
96
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7923 ;
98
id int(11) NOT NULL auto_increment,
99
text varchar(100) NOT NULL default '',
102
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=63 ;
104
id int(11) NOT NULL auto_increment,
105
forum int(11) NOT NULL default '0',
106
betreff varchar(70) NOT NULL default '',
109
FULLTEXT KEY betreff (betreff)
110
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=996 ;
111
select a.text, b.id, b.betreff
113
t2 a inner join t3 b on a.id = b.forum inner join
114
t1 c on b.id = c.thread
116
match(b.betreff) against ('+abc' in boolean mode)
117
group by a.text, b.id, b.betreff
119
select a.text, b.id, b.betreff
121
t2 a inner join t3 b on a.id = b.forum inner join
122
t1 c on b.id = c.thread
124
match(c.beitrag) against ('+abc' in boolean mode)
126
a.text, b.id, b.betreff
128
match(b.betreff) against ('+abc' in boolean mode) desc;
129
ERROR 42S22: Unknown column 'b.betreff' in 'order clause'
130
select a.text, b.id, b.betreff
132
t2 a inner join t3 b on a.id = b.forum inner join
133
t1 c on b.id = c.thread
135
match(b.betreff) against ('+abc' in boolean mode)
137
select a.text, b.id, b.betreff
139
t2 a inner join t3 b on a.id = b.forum inner join
140
t1 c on b.id = c.thread
142
match(c.beitrag) against ('+abc' in boolean mode)
144
match(b.betreff) against ('+abc' in boolean mode) desc;
145
ERROR 42S22: Unknown column 'b.betreff' in 'order clause'
146
select a.text, b.id, b.betreff
148
t2 a inner join t3 b on a.id = b.forum inner join
149
t1 c on b.id = c.thread
151
match(b.betreff) against ('+abc' in boolean mode)
153
select a.text, b.id, b.betreff
155
t2 a inner join t3 b on a.id = b.forum inner join
156
t1 c on b.id = c.thread
158
match(c.beitrag) against ('+abc' in boolean mode)
160
match(betreff) against ('+abc' in boolean mode) desc;
162
(select b.id, b.betreff from t3 b) union
163
(select b.id, b.betreff from t3 b)
164
order by match(betreff) against ('+abc' in boolean mode) desc;
166
(select b.id, b.betreff from t3 b) union
167
(select b.id, b.betreff from t3 b)
168
order by match(betreff) against ('+abc') desc;
169
ERROR HY000: Can't find FULLTEXT index matching the column list
170
select distinct b.id, b.betreff from t3 b
171
order by match(betreff) against ('+abc' in boolean mode) desc;
173
select b.id, b.betreff from t3 b group by b.id+1
174
order by match(betreff) against ('+abc' in boolean mode) desc;