Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add a test for DECIMAL with fractional seconds for PRIMARY KEY.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
test/sql/suite/mroonga_storage/r/primary_key_decimal_with_fractional_seconds.result
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,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; |
39 changes: 39 additions & 0 deletions
39
test/sql/suite/mroonga_storage/t/primary_key_decimal_with_fractional_seconds.test
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,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 |