Navigation Menu

Skip to content

Commit

Permalink
test: add tests for overflowed YEAR value on 32bit environment
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 24, 2012
1 parent 38fdb10 commit 606c9ce
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
@@ -0,0 +1,16 @@
DROP TABLE IF EXISTS ranges;
CREATE TABLE ranges (
id INT PRIMARY KEY,
start YEAR,
end YEAR,
UNIQUE KEY range_key(start, end)
);
INSERT INTO ranges VALUES (1, 1901, 2012);
INSERT INTO ranges VALUES (2, 1901, 2155);
INSERT INTO ranges VALUES (3, 2012, 2155);
INSERT INTO ranges VALUES (4, 2155, 1901);
SELECT * FROM ranges FORCE INDEX(range_key)
WHERE start = 1901 AND end = 2155;
id start end
2 1970 2155
DROP TABLE ranges;
Expand Up @@ -15,6 +15,7 @@
# 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_32bit.inc
--source include/have_mroonga.inc

--disable_warnings
Expand Down
@@ -0,0 +1,42 @@
# Copyright(C) 2012 Kentoku SHIBA
# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

--source include/have_64bit.inc
--source include/have_mroonga.inc

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

CREATE TABLE ranges (
id INT PRIMARY KEY,
start YEAR,
end YEAR,
UNIQUE KEY range_key(start, end)
);

INSERT INTO ranges VALUES (1, 1901, 2012);
INSERT INTO ranges VALUES (2, 1901, 2155);
INSERT INTO ranges VALUES (3, 2012, 2155);
INSERT INTO ranges VALUES (4, 2155, 1901);

SELECT * FROM ranges FORCE INDEX(range_key)
WHERE start = 1901 AND end = 2155;

DROP TABLE ranges;

--source include/have_mroonga_deinit.inc

0 comments on commit 606c9ce

Please sign in to comment.