null+****@clear*****
null+****@clear*****
2011年 11月 3日 (木) 14:53:03 JST
Kouhei Sutou 2011-11-03 05:53:03 +0000 (Thu, 03 Nov 2011) New Revision: e75ae61caae3cfe10ae9b99904f060240a275ebf Log: [wrapper][test] add tests for bulk insert. refs #1154 It works for data but got an error on MySQL 5.5.16: [ERROR] Transaction not registered for MySQL 2PC, but transaction is active Added files: test/sql/groonga_wrapper/r/bulk_insert.result test/sql/groonga_wrapper/t/bulk_insert.test Added: test/sql/groonga_wrapper/r/bulk_insert.result (+30 -0) 100644 =================================================================== --- /dev/null +++ test/sql/groonga_wrapper/r/bulk_insert.result 2011-11-03 05:53:03 +0000 (b8ca82b) @@ -0,0 +1,30 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +content text, +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, + `content` text, + PRIMARY KEY (`id`), + FULLTEXT KEY `content` (`content`) +) ENGINE=groonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' +LOCK TABLE diaries WRITE; +insert into diaries values(1, "今日からはじめました。"); +insert into diaries values(2, "明日の富士山の天気について"); +insert into diaries values(3, "今日も天気がよくてきれいに見える。"); +UNLOCK TABLES; +select * from diaries; +id content +1 今日からはじめました。 +2 明日の富士山の天気について +3 今日も天気がよくてきれいに見える。 +select * from diaries where match(content) against("天気"); +id content +2 明日の富士山の天気について +3 今日も天気がよくてきれいに見える。 +drop table diaries; Added: test/sql/groonga_wrapper/t/bulk_insert.test (+43 -0) 100644 =================================================================== --- /dev/null +++ test/sql/groonga_wrapper/t/bulk_insert.test 2011-11-03 05:53:03 +0000 (643ee63) @@ -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, + content text, + fulltext index (content) +) default charset utf8 comment = 'engine "innodb"'; +show create table diaries; + +LOCK TABLE diaries WRITE; +insert into diaries values(1, "今日からはじめました。"); +insert into diaries values(2, "明日の富士山の天気について"); +insert into diaries values(3, "今日も天気がよくてきれいに見える。"); +UNLOCK TABLES; + +select * from diaries; + +select * from diaries where match(content) against("天気"); + +drop table diaries; + +--source suite/groonga_include/groonga_deinit.inc