Navigation Menu

Skip to content

Commit

Permalink
test: add a test for DECIMAL with 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 b9f02c9 commit 0bb1ea5
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(6, 3) PRIMARY KEY,
message TEXT
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE releases;
Table Create Table
releases CREATE TABLE `releases` (
`version` decimal(6,3) NOT NULL,
`message` text,
PRIMARY KEY (`version`)
) ENGINE=mroonga DEFAULT CHARSET=utf8
INSERT INTO releases (version, message) VALUES (10.000, "10th release!");
INSERT INTO releases (version, message) VALUES (10.001, "minor fix.");
INSERT INTO releases (version, message) VALUES (999.999, "the last release!");
SELECT * FROM releases;
version message
10.000 10th release!
10.001 minor fix.
999.999 the last release!
SELECT * FROM releases WHERE version BETWEEN "9.000" AND "10.001";
version message
10.000 10th release!
10.001 minor fix.
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(6, 3) PRIMARY KEY,
message TEXT
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE releases;

INSERT INTO releases (version, message) VALUES (10.000, "10th release!");
INSERT INTO releases (version, message) VALUES (10.001, "minor fix.");
INSERT INTO releases (version, message) VALUES (999.999, "the last release!");

SELECT * FROM releases;

SELECT * FROM releases WHERE version BETWEEN "9.000" AND "10.001";

DROP TABLE releases;

--source include/have_mroonga_deinit.inc

0 comments on commit 0bb1ea5

Please sign in to comment.