1
by brian
clean slate |
1 |
#
|
2 |
# Bugreport due to Roy Nasser <roy@vem.ca>
|
|
3 |
#
|
|
4 |
||
5 |
--disable_warnings |
|
6 |
drop table if exists t1, t2; |
|
7 |
--enable_warnings |
|
8 |
||
9 |
CREATE TABLE t1 ( |
|
10 |
id int(10) unsigned NOT NULL auto_increment, |
|
11 |
q varchar(255) default NULL, |
|
12 |
PRIMARY KEY (id) |
|
13 |
);
|
|
14 |
INSERT INTO t1 VALUES (1,'aaaaaaaaa dsaass de'); |
|
15 |
INSERT INTO t1 VALUES (2,'ssde df s fsda sad er'); |
|
16 |
CREATE TABLE t2 ( |
|
17 |
id int(10) unsigned NOT NULL auto_increment, |
|
18 |
id2 int(10) unsigned default NULL, |
|
19 |
item varchar(255) default NULL, |
|
20 |
PRIMARY KEY (id), |
|
21 |
FULLTEXT KEY item(item) |
|
22 |
);
|
|
23 |
INSERT INTO t2 VALUES (1,1,'sushi'); |
|
24 |
INSERT INTO t2 VALUES (2,1,'Bolo de Chocolate'); |
|
25 |
INSERT INTO t2 VALUES (3,1,'Feijoada'); |
|
26 |
INSERT INTO t2 VALUES (4,1,'Mousse de Chocolate'); |
|
27 |
INSERT INTO t2 VALUES (5,2,'um copo de Vodka'); |
|
28 |
INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); |
|
29 |
INSERT INTO t2 VALUES (7,1,'Bife'); |
|
30 |
INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); |
|
31 |
||
32 |
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) |
|
33 |
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; |
|
34 |
||
35 |
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) |
|
36 |
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; |
|
37 |
||
38 |
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) |
|
39 |
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; |
|
40 |
||
41 |
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) |
|
42 |
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; |
|
43 |
||
44 |
drop table t1, t2; |
|
45 |
||
46 |
# End of 4.1 tests
|