# Copyright(C) 2013 Kentoku SHIBA
# Copyright(C) 2018 Kouhei Sutou <kou@clear-code.com>
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

--source ../../../../../include/mroonga/have_mroonga.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

CREATE TABLE t1 (
  id INT PRIMARY KEY AUTO_INCREMENT,
  c1 SMALLINT UNSIGNED,
  c2 SMALLINT UNSIGNED,
  KEY idx1(c1, c2)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO t1 (c1, c2) VALUES
  (1999, 12),
  (2000, 11),
  (2001, 10),
  (2002, 9),
  (2003, 8),
  (2004, 7),
  (2005, 6),
  (2006, 5),
  (2007, 4),
  (2008, 3),
  (2009, 2),
  (2010, 1);

SELECT * FROM t1 WHERE c1 > 2005;
SELECT * FROM t1 WHERE c1 >= 2005;
SELECT * FROM t1 WHERE c1 = 2005;
SELECT * FROM t1 WHERE c1 <= 2005;
SELECT * FROM t1 WHERE c1 < 2005;

DROP TABLE t1;

--source ../../../../../include/mroonga/have_mroonga_deinit.inc
