[Groonga-mysql-commit] mroonga/mroonga [master] [wrapper][multiple-column-index] add a test for update. refs #1031

Back to archive index

null+****@clear***** null+****@clear*****
2011年 7月 22日 (金) 10:37:27 JST


Kouhei Sutou	2011-07-22 01:37:27 +0000 (Fri, 22 Jul 2011)

  New Revision: bcc486c8f1699b6da6af426534e9a2b43d0f08bc

  Log:
    [wrapper][multiple-column-index] add a test for update. refs #1031

  Added files:
    test/sql/groonga_wrapper/r/fulltext_multiple_column_index_update.result
    test/sql/groonga_wrapper/t/fulltext_multiple_column_index_update.test

  Added: test/sql/groonga_wrapper/r/fulltext_multiple_column_index_update.result (+37 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/groonga_wrapper/r/fulltext_multiple_column_index_update.result    2011-07-22 01:37:27 +0000 (6a70c59)
@@ -0,0 +1,37 @@
+drop table if exists diaries;
+set names utf8;
+create table diaries (
+id int primary key,
+title varchar(255),
+content text,
+fulltext index (title, content),
+fulltext index (title),
+fulltext index (content)
+) default charset utf8 COMMENT = 'engine "innodb"';
+show create table diaries;
+Table	Create Table
+diaries	CREATE TABLE `diaries` (
+  `id` int(11) NOT NULL,
+  `title` varchar(255) DEFAULT NULL,
+  `content` text,
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title` (`title`,`content`),
+  FULLTEXT KEY `title_2` (`title`),
+  FULLTEXT KEY `content` (`content`)
+) ENGINE=groonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"'
+insert into diaries values(1, "Hello", "はじめました。");
+insert into diaries values(2, "天気", "明日の富士山の天気について");
+insert into diaries values(3, "富士山", "今日もきれい。");
+update diaries set title = "チョモランマと富士山" where id = 1;
+update diaries set title = "チョモランマ" where id = 3;
+select * from diaries where match(title, content) against("富士山");
+id	title	content
+1	チョモランマと富士山	はじめました。
+2	天気	明日の富士山の天気について
+select * from diaries where match(title) against("富士山");
+id	title	content
+1	チョモランマと富士山	はじめました。
+select * from diaries where match(content) against("富士山");
+id	title	content
+2	天気	明日の富士山の天気について
+drop table diaries;

  Added: test/sql/groonga_wrapper/t/fulltext_multiple_column_index_update.test (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/groonga_wrapper/t/fulltext_multiple_column_index_update.test    2011-07-22 01:37:27 +0000 (1c896e2)
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 Kouhei Sutou <kou****@clear*****>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+--source suite/groonga_include/groonga_init.inc
+
+--disable_warnings
+drop table if exists diaries;
+--enable_warnings
+
+set names utf8;
+create table diaries (
+  id int primary key,
+  title varchar(255),
+  content text,
+  fulltext index (title, content),
+  fulltext index (title),
+  fulltext index (content)
+) default charset utf8 COMMENT = 'engine "innodb"';
+show create table diaries;
+insert into diaries values(1, "Hello", "はじめました。");
+insert into diaries values(2, "天気", "明日の富士山の天気について");
+insert into diaries values(3, "富士山", "今日もきれい。");
+update diaries set title = "チョモランマと富士山" where id = 1;
+update diaries set title = "チョモランマ" where id = 3;
+select * from diaries where match(title, content) against("富士山");
+select * from diaries where match(title) against("富士山");
+select * from diaries where match(content) against("富士山");
+drop table diaries;
+
+--source suite/groonga_include/groonga_deinit.inc




Groonga-mysql-commit メーリングリストの案内
Back to archive index