1# Copyright(C) 2012 Kentoku SHIBA 2# Copyright(C) 2012-2016 Kouhei Sutou <kou@clear-code.com> 3# 4# This library is free software; you can redistribute it and/or 5# modify it under the terms of the GNU Lesser General Public 6# License as published by the Free Software Foundation; either 7# version 2.1 of the License, or (at your option) any later version. 8# 9# This library is distributed in the hope that it will be useful, 10# but WITHOUT ANY WARRANTY; without even the implied warranty of 11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12# Lesser General Public License for more details. 13# 14# You should have received a copy of the GNU Lesser General Public 15# License along with this library; if not, write to the Free Software 16# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA 17 18--source ../../include/mroonga/have_mroonga.inc 19 20--disable_warnings 21DROP TABLE IF EXISTS ranges; 22--enable_warnings 23 24CREATE TABLE ranges ( 25 id int PRIMARY KEY, 26 start timestamp DEFAULT '2016-04-21 00:00:00', 27 end timestamp DEFAULT '2016-04-22 00:00:00', 28 UNIQUE KEY range_key(start, end) 29); 30 31INSERT INTO ranges VALUES (1, "1970-01-01 12:00:00", "2012-10-05 16:18:29"); 32INSERT INTO ranges VALUES (2, "1970-01-01 12:00:00", "2038-01-18 15:14:07"); 33INSERT INTO ranges VALUES (3, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); 34INSERT INTO ranges VALUES (4, "2038-01-18 15:14:07", "1970-01-01 12:00:00"); 35 36SELECT start, end 37 FROM ranges FORCE INDEX(range_key) 38 ORDER BY start, end; 39 40DROP TABLE ranges; 41 42--source ../../include/mroonga/have_mroonga_deinit.inc 43