Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test][truncate][storage] add expected result. refs #1151
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| DROP TABLE IF EXISTS diaries; | ||
| SET NAMES UTF8; | ||
| CREATE TABLE diaries ( | ||
| id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
| year INT UNSIGNED, | ||
| month INT UNSIGNED, | ||
| day INT UNSIGNED, | ||
| title VARCHAR(255), | ||
| content TEXT, | ||
| FULLTEXT INDEX(content), | ||
| KEY(day) | ||
| ) DEFAULT CHARSET UTF8; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
| `year` int(10) unsigned DEFAULT NULL, | ||
| `month` int(10) unsigned DEFAULT NULL, | ||
| `day` int(10) unsigned DEFAULT NULL, | ||
| `title` varchar(255) DEFAULT NULL, | ||
| `content` text, | ||
| PRIMARY KEY (`id`), | ||
| KEY `day` (`day`), | ||
| FULLTEXT KEY `content` (`content`) | ||
| ) ENGINE=groonga DEFAULT CHARSET=utf8 | ||
| INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日からはじめました。"); | ||
| INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日の富士山の天気について"); | ||
| INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); | ||
| TRUNCATE TABLE diaries; | ||
| SELECT * FROM diaries; | ||
| id year month day title content | ||
| SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); | ||
| id year month day title content | ||
| INSERT INTO diaries VALUES(1, 2011, 11, 11, "帰り道", "つかれたー"); | ||
| INSERT INTO diaries VALUES(2, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); | ||
| INSERT INTO diaries VALUES(3, 2011, 12, 2, "初雪", "今年はじめての雪!"); | ||
| SELECT * FROM diaries; | ||
| id year month day title content | ||
| 1 2011 11 11 帰り道 つかれたー | ||
| 2 2011 12 1 久しぶり 天気が悪いからずっと留守番。 | ||
| 3 2011 12 2 初雪 今年はじめての雪! | ||
| SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); | ||
| id year month day title content | ||
| 2 2011 12 1 久しぶり 天気が悪いからずっと留守番。 | ||
| DROP TABLE diaries; |