diff options
author | sasha@mysql.sashanet.com <> | 2001-07-30 17:43:58 -0600 |
---|---|---|
committer | sasha@mysql.sashanet.com <> | 2001-07-30 17:43:58 -0600 |
commit | d31b49f32876be60bbfb9d161197e7f278ee2685 (patch) | |
tree | f3b341b23b11359f2c13a526a56a7b50d254a2e4 /mysql-test | |
parent | 72c39117dffeef9af51833ea32b9d71db67514eb (diff) | |
download | mariadb-git-d31b49f32876be60bbfb9d161197e7f278ee2685.tar.gz |
added test case for fulltext join bug
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'); |