config root man

Current Path : /usr/opt/mysql57/mysql-test/suite/innodb_fts/r/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/mysql57/mysql-test/suite/innodb_fts/r/ngram_2.result

SET NAMES utf8;
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
content TEXT,
FULLTEXT INDEX ft_content (content)
) ENGINE=InnoDB DEFAULT CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
INSERT INTO t1 (title, content) VALUES  ('中国', '中国'), ('中国上海', '中国上海');
ALTER TABLE t1 ADD FULLTEXT INDEX ft_title (title);
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) DEFAULT NULL,
  `content` text,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `ft_content` (`content`),
  FULLTEXT KEY `ft_title` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=gb2312
SELECT * FROM t1 WHERE MATCH(title) AGAINST('中国');
id	title	content
SELECT * FROM t1 WHERE MATCH(title) AGAINST('中国上海');
id	title	content
2	中国上海	中国上海
SELECT * FROM t1 WHERE MATCH(content) AGAINST('中国');
id	title	content
SELECT * FROM t1 WHERE MATCH(content) AGAINST('中国上海');
id	title	content
2	中国上海	中国上海
DROP TABLE t1;
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
content TEXT,
FULLTEXT INDEX ft_content (content) WITH PARSER ngram
) ENGINE=InnoDB DEFAULT CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
INSERT INTO t1 (title, content) VALUES  ('中国', '中国'), ('中国上海', '中国上海');
ALTER TABLE t1 ADD FULLTEXT INDEX ft_title (title) WITH PARSER ngram;
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) DEFAULT NULL,
  `content` text,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `ft_content` (`content`) /*!50100 WITH PARSER `ngram` */ ,
  FULLTEXT KEY `ft_title` (`title`) /*!50100 WITH PARSER `ngram` */ 
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=gb2312
SELECT * FROM t1 WHERE MATCH(title) AGAINST('中国');
id	title	content
1	中国	中国
2	中国上海	中国上海
SELECT * FROM t1 WHERE MATCH(title) AGAINST('中国上海');
id	title	content
2	中国上海	中国上海
1	中国	中国
SELECT * FROM t1 WHERE MATCH(content) AGAINST('中国');
id	title	content
1	中国	中国
2	中国上海	中国上海
SELECT * FROM t1 WHERE MATCH(content) AGAINST('中国上海');
id	title	content
2	中国上海	中国上海
1	中国	中国
CREATE TABLE t2 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
content TEXT,
FULLTEXT INDEX ft_content (content) WITH PARSER ngram
) ENGINE=InnoDB DEFAULT CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
ALTER TABLE t2 ADD FULLTEXT INDEX ft_title (title) WITH PARSER ngram;
# restart: --ngram=OFF
CHECK TABLE t1;
Table	Op	Msg_type	Msg_text
test.t1	check	Error	Plugin 'ngram' is not loaded
test.t1	check	Error	Incorrect information in file: './test/t1.frm'
test.t1	check	error	Corrupt
SELECT * FROM t1;
ERROR HY000: Plugin 'ngram' is not loaded
SELECT * FROM t1 WHERE MATCH(title) AGAINST('中国');
ERROR HY000: Plugin 'ngram' is not loaded
SELECT * FROM t1 WHERE MATCH(title) AGAINST('中国上海');
ERROR HY000: Plugin 'ngram' is not loaded
SELECT * FROM t1 WHERE MATCH(content) AGAINST('中国');
ERROR HY000: Plugin 'ngram' is not loaded
SELECT * FROM t1 WHERE MATCH(content) AGAINST('中国上海');
ERROR HY000: Plugin 'ngram' is not loaded
INSERT INTO t1 (title, content) VALUES  ('中国', '中国');
ERROR HY000: Plugin 'ngram' is not loaded
DROP INDEX ft_title ON t1;
ERROR HY000: Plugin 'ngram' is not loaded
DROP INDEX ft_content ON t1;
ERROR HY000: Plugin 'ngram' is not loaded
TRUNCATE TABLE t1;
ERROR HY000: Plugin 'ngram' is not loaded
ALTER TABLE t1 RENAME TO t3;
ERROR HY000: Plugin 'ngram' is not loaded
RENAME TABLE t2 to t3;
DROP TABLE t3;
CREATE TABLE t2 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
FULLTEXT INDEX ft_title (title) WITH PARSER ngram
) ENGINE=InnoDB DEFAULT CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
ERROR HY000: Function 'ngram' is not defined
CREATE TABLE t2 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200)
) ENGINE=InnoDB DEFAULT CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
ALTER TABLE t2 ADD FULLTEXT INDEX ft_title (title) WITH PARSER ngram;
ERROR HY000: Function 'ngram' is not defined
ALTER TABLE t2 ADD FULLTEXT INDEX ft_title (title);
Warnings:
Warning	124	InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t2 (title) VALUES  ('中国');
SELECT * FROM t2 WHERE MATCH(title) AGAINST('中国');
id	title
SELECT * FROM t2 WHERE MATCH(title) AGAINST('中国上海');
id	title
DROP TABLE t2;
# restart
CHECK TABLE t1;
Table	Op	Msg_type	Msg_text
test.t1	check	status	OK
SELECT * FROM t1;
id	title	content
1	中国	中国
2	中国上海	中国上海
SELECT * FROM t1 WHERE MATCH(title) AGAINST('中国');
id	title	content
1	中国	中国
2	中国上海	中国上海
SELECT * FROM t1 WHERE MATCH(title) AGAINST('中国上海');
id	title	content
2	中国上海	中国上海
1	中国	中国
SELECT * FROM t1 WHERE MATCH(content) AGAINST('中国');
id	title	content
1	中国	中国
2	中国上海	中国上海
SELECT * FROM t1 WHERE MATCH(content) AGAINST('中国上海');
id	title	content
2	中国上海	中国上海
1	中国	中国
DROP TABLE t1;

Man Man