Navigation Menu

Skip to content

Commit

Permalink
[test][storage] add a test for insert/select decimal column value.
Browse files Browse the repository at this point in the history
refs #1249
  • Loading branch information
kou committed Jan 14, 2012
1 parent bae8e77 commit 9c7587b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/sql/suite/mroonga_storage/r/column_decimal.result
@@ -0,0 +1,23 @@
DROP TABLE IF EXISTS diaries;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
temperature DECIMAL(6, 3)
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE diaries;
Table Create Table
diaries CREATE TABLE `diaries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` text,
`temperature` decimal(6,3) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=mroonga DEFAULT CHARSET=utf8
INSERT INTO diaries (title, temperature) VALUES ("clear day", 21.281);
INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14.213);
INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17.821);
SELECT * FROM diaries;
id title temperature
1 clear day 21.281
2 rainy day 14.213
3 cloudy day 17.821
DROP TABLE diaries;
37 changes: 37 additions & 0 deletions test/sql/suite/mroonga_storage/t/column_decimal.test
@@ -0,0 +1,37 @@
# 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 diaries;
--enable_warnings

CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
temperature DECIMAL(6, 3)
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE diaries;

INSERT INTO diaries (title, temperature) VALUES ("clear day", 21.281);
INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14.213);
INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17.821);
SELECT * FROM diaries;

DROP TABLE diaries;

--source include/have_mroonga_deinit.inc

0 comments on commit 9c7587b

Please sign in to comment.