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