diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-07-30 17:44:33 -0600 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-07-30 17:44:33 -0600 |
commit | eaa1ea45f8ea6233892fe6c4746c35f01d2d9c6d (patch) | |
tree | 941764d7880bb7b38b0ba156b9fa284b0530e38e /mysql-test | |
parent | ebde3d6deefc3553cca5e241d0a2764db71c232d (diff) | |
parent | d078b8f817ba667bb1e36029c5c40864e4b48221 (diff) | |
download | mariadb-git-eaa1ea45f8ea6233892fe6c4746c35f01d2d9c6d.tar.gz |
Merge work:/home/bk/mysql
into mysql.sashanet.com:/home/sasha/src/bk/mysql
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/t/fulltext_join.test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/fulltext_join.test b/mysql-test/t/fulltext_join.test new file mode 100644 index 00000000000..c5e6037180a --- /dev/null +++ b/mysql-test/t/fulltext_join.test @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS stories; +CREATE TABLE stories ( + sid char(16) NOT NULL, + tid smallint UNSIGNED NOT NULL, + uid mediumint UNSIGNED NOT NULL, + title varchar(100) DEFAULT '' NOT NULL, + dept varchar(100), + time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + hits mediumint UNSIGNED DEFAULT '0' NOT NULL, + section varchar(30) DEFAULT '' NOT NULL, + displaystatus tinyint DEFAULT '0' NOT NULL, + commentstatus tinyint, + discussion mediumint UNSIGNED, + submitter mediumint UNSIGNED NOT NULL, + flags set("delete_me","data_dirty") DEFAULT '' NOT NULL, + PRIMARY KEY (sid), + FOREIGN KEY (uid) REFERENCES users(uid), + FOREIGN KEY (tid) REFERENCES tid(topic), + FOREIGN KEY (section) REFERENCES sections(section), + KEY time (time), + KEY searchform (displaystatus,time) +) TYPE = myisam; +DROP TABLE IF EXISTS story_text; +CREATE TABLE story_text ( + sid char(16) NOT NULL, + introtext text, + bodytext text, + relatedtext text, + FOREIGN KEY (sid) REFERENCES stories(sid), + PRIMARY KEY (sid) +) TYPE = myisam; +ALTER TABLE stories add fulltext (title); +ALTER TABLE story_text add fulltext (introtext,bodytext); + +SELECT stories.sid,title, TRUNCATE((MATCH (title,introtext,bodytext) +AGAINST('install')), 1) as score FROM stories,story_text WHERE +stories.sid = story_text.sid AND MATCH (title,introtext,bodytext) +AGAINST ('install'); |