1
DROP TABLE IF EXISTS t1, t2;
3
id mediumint unsigned NOT NULL auto_increment,
4
tag char(6) NOT NULL default '',
5
value text NOT NULL default '',
9
FULLTEXT KEY kvf(value)
12
Warning 1101 BLOB/TEXT column 'value' can't have a default value
14
id_t2 mediumint unsigned NOT NULL default '0',
15
id_t1 mediumint unsigned NOT NULL default '0',
16
field_number tinyint unsigned NOT NULL default '0',
17
PRIMARY KEY (id_t2,id_t1,field_number),
20
INSERT INTO t1 (tag,value) VALUES ('foo123','bar111');
21
INSERT INTO t1 (tag,value) VALUES ('foo123','bar222');
22
INSERT INTO t1 (tag,value) VALUES ('bar345','baz333 ar');
23
INSERT INTO t2 VALUES (2231626,64280,0);
24
INSERT INTO t2 VALUES (2231626,64281,0);
25
INSERT INTO t2 VALUES (12346, 3, 1);
32
id_t2 id_t1 field_number
36
SELECT DISTINCT t2.id_t2 FROM t2, t1
37
WHERE MATCH (t1.value) AGAINST ('baz333') AND t1.id = t2.id_t1;
40
SELECT DISTINCT t2.id_t2 FROM t2, t1
41
WHERE MATCH (t1.value) AGAINST ('baz333' IN BOOLEAN MODE)