1# Copyright(C) 2013 Kentoku SHIBA
2#
3# This library is free software; you can redistribute it and/or
4# modify it under the terms of the GNU Lesser General Public
5# License as published by the Free Software Foundation; either
6# version 2.1 of the License, or (at your option) any later version.
7#
8# This library is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11# Lesser General Public License for more details.
12#
13# You should have received a copy of the GNU Lesser General Public
14# License along with this library; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1335  USA
16
17--source ../../include/mroonga/have_mroonga.inc
18
19--disable_warnings
20DROP TABLE IF EXISTS mroonga_releases;
21--enable_warnings
22
23FLUSH STATUS;
24
25CREATE TABLE mroonga_releases (
26  id INT PRIMARY KEY AUTO_INCREMENT,
27  release_title TEXT,
28  release_year YEAR,
29  KEY (release_year),
30  FULLTEXT KEY (release_title)
31) DEFAULT CHARSET UTF8;
32
33INSERT INTO mroonga_releases (release_title, release_year)
34       VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10");
35INSERT INTO mroonga_releases (release_title, release_year)
36       VALUES ("Rename Groonga storage engine to Mroonga", "2011");
37INSERT INTO mroonga_releases (release_title, release_year)
38       VALUES ("Mroonga 2.0 has been released", "2012");
39INSERT INTO mroonga_releases (release_title, release_year)
40       VALUES ("Mroonga 3.0 has been released", "13");
41INSERT INTO mroonga_releases (release_title, release_year)
42       VALUES ("Mroonga 4.0 will be released", "2014");
43
44SELECT * FROM mroonga_releases
45         WHERE release_year <= "13" AND
46               MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE)
47         ORDER BY id DESC LIMIT 1,2;
48
49SHOW STATUS LIKE 'mroonga_fast_order_limit';
50
51DROP TABLE mroonga_releases;
52
53--source ../../include/mroonga/have_mroonga_deinit.inc
54