Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test][storage] add a test for insert/select decimal column value.
refs #1249
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |