null+****@clear*****
null+****@clear*****
2012年 2月 17日 (金) 17:21:18 JST
Kouhei Sutou 2012-02-17 17:21:18 +0900 (Fri, 17 Feb 2012)
New Revision: 24e8e29444b570e6dba62ac34325564de32b1fba
Log:
test: add a test for TIME with fractional seconds for PRIMARY KEY.
Added files:
test/sql/suite/mroonga_storage/r/primary_key_time_with_fractional_seconds.result
test/sql/suite/mroonga_storage/t/primary_key_time_with_fractional_seconds.test
Added: test/sql/suite/mroonga_storage/r/primary_key_time_with_fractional_seconds.result (+29 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/r/primary_key_time_with_fractional_seconds.result 2012-02-17 17:21:18 +0900 (029f49a)
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS running_records;
+CREATE TABLE running_records (
+time TIME(6) PRIMARY KEY,
+title TEXT
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE running_records;
+Table Create Table
+running_records CREATE TABLE `running_records` (
+ `time` time(6) NOT NULL,
+ `title` text,
+ PRIMARY KEY (`time`)
+) ENGINE=mroonga DEFAULT CHARSET=utf8
+INSERT INTO running_records (time, title)
+VALUES ("01:00:00.000001", "normal condition");
+INSERT INTO running_records (time, title)
+VALUES ("12:23:34.123456", "bad condition");
+INSERT INTO running_records (time, title)
+VALUES ("-838:59:59.000000", "record failure");
+SELECT * FROM running_records;
+time title
+-838:59:59.000000 record failure
+01:00:00.000001 normal condition
+12:23:34.123456 bad condition
+SELECT * FROM running_records
+WHERE time BETWEEN "00:59:59.999999" AND "12:23:34.123456";
+time title
+01:00:00.000001 normal condition
+12:23:34.123456 bad condition
+DROP TABLE running_records;
Added: test/sql/suite/mroonga_storage/t/primary_key_time_with_fractional_seconds.test (+44 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/t/primary_key_time_with_fractional_seconds.test 2012-02-17 17:21:18 +0900 (5791607)
@@ -0,0 +1,44 @@
+# Copyright(C) 2012 Kouhei Sutou <kou****@clear*****>
+#
+# 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
+--source include/have_fractional_seconds.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS running_records;
+--enable_warnings
+
+CREATE TABLE running_records (
+ time TIME(6) PRIMARY KEY,
+ title TEXT
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE running_records;
+
+INSERT INTO running_records (time, title)
+ VALUES ("01:00:00.000001", "normal condition");
+INSERT INTO running_records (time, title)
+ VALUES ("12:23:34.123456", "bad condition");
+INSERT INTO running_records (time, title)
+ VALUES ("-838:59:59.000000", "record failure");
+
+SELECT * FROM running_records;
+
+SELECT * FROM running_records
+ WHERE time BETWEEN "00:59:59.999999" AND "12:23:34.123456";
+
+DROP TABLE running_records;
+
+--source include/have_mroonga_deinit.inc