Kouhei Sutou
null+****@clear*****
Sun Nov 18 14:35:25 JST 2012
Kouhei Sutou 2012-11-18 14:35:25 +0900 (Sun, 18 Nov 2012) New Revision: 02852e83543c6c533f1d28cdcd2e5175b3694f0f https://github.com/mroonga/mroonga/commit/02852e83543c6c533f1d28cdcd2e5175b3694f0f Log: test: add a test for MATCH AGAINST OR MATCH AGAINST Added files: test/sql/suite/mroonga/storage/fulltext/r/or.result test/sql/suite/mroonga/storage/fulltext/t/or.test Added: test/sql/suite/mroonga/storage/fulltext/r/or.result (+22 -0) 100644 =================================================================== --- /dev/null +++ test/sql/suite/mroonga/storage/fulltext/r/or.result 2012-11-18 14:35:25 +0900 (f1f7888) @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT * +FROM diaries +WHERE MATCH(title) AGAINST("Ruby" IN BOOLEAN MODE) OR +MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +title +Start mroonga +Start groonga and Ruby +DROP TABLE diaries; Added: test/sql/suite/mroonga/storage/fulltext/t/or.test (+42 -0) 100644 =================================================================== --- /dev/null +++ test/sql/suite/mroonga/storage/fulltext/t/or.test 2012-11-18 14:35:25 +0900 (8f6bc5c) @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kouhei Sutou +# +# 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 include/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT * + FROM diaries + WHERE MATCH(title) AGAINST("Ruby" IN BOOLEAN MODE) OR + MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source include/have_mroonga_deinit.inc -------------- next part -------------- HTML����������������������������... ダウンロード