Navigation Menu

Skip to content

Commit

Permalink
test: add a test for DECIMAL without fractional seconds for PRIMARY KEY.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 17, 2012
1 parent 0bb1ea5 commit b47916d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
@@ -0,0 +1,25 @@
DROP TABLE IF EXISTS releases;
CREATE TABLE releases (
version DECIMAL PRIMARY KEY,
message TEXT
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE releases;
Table Create Table
releases CREATE TABLE `releases` (
`version` decimal(10,0) NOT NULL,
`message` text,
PRIMARY KEY (`version`)
) ENGINE=mroonga DEFAULT CHARSET=utf8
INSERT INTO releases (version, message) VALUES (1, "the first release!!!");
INSERT INTO releases (version, message) VALUES (10, "10th release!");
INSERT INTO releases (version, message) VALUES (999, "the last release!");
SELECT * FROM releases;
version message
1 the first release!!!
10 10th release!
999 the last release!
SELECT * FROM releases WHERE version BETWEEN "1" AND "10";
version message
1 the first release!!!
10 10th release!
DROP TABLE releases;
@@ -0,0 +1,39 @@
# 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_mroonga.inc

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

CREATE TABLE releases (
version DECIMAL PRIMARY KEY,
message TEXT
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE releases;

INSERT INTO releases (version, message) VALUES (1, "the first release!!!");
INSERT INTO releases (version, message) VALUES (10, "10th release!");
INSERT INTO releases (version, message) VALUES (999, "the last release!");

SELECT * FROM releases;

SELECT * FROM releases WHERE version BETWEEN "1" AND "10";

DROP TABLE releases;

--source include/have_mroonga_deinit.inc

0 comments on commit b47916d

Please sign in to comment.