[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] test: add a test for DECIMAL without fractional seconds for PRIMARY KEY.

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 10:37:52 JST 2012


Kouhei Sutou	2012-02-17 16:58:37 +0900 (Fri, 17 Feb 2012)

  New Revision: b47916deb4da4e023dad26d105edf0dbefdf369f
  https://github.com/mroonga/mroonga/commit/b47916deb4da4e023dad26d105edf0dbefdf369f

  Log:
    test: add a test for DECIMAL without fractional seconds for PRIMARY KEY.

  Added files:
    test/sql/suite/mroonga_storage/r/primary_key_decimal_without_fractional_seconds.result
    test/sql/suite/mroonga_storage/t/primary_key_decimal_without_fractional_seconds.test

  Added: test/sql/suite/mroonga_storage/r/primary_key_decimal_without_fractional_seconds.result (+25 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/r/primary_key_decimal_without_fractional_seconds.result    2012-02-17 16:58:37 +0900 (a3dc337)
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS releases;
+CREATE TABLE releases (
+version DECIMAL PRIMARY KEY,
+message TEXT
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE releases;
+Table	Create Table
+releases	CREATE TABLE `releases` (
+  `version` decimal(10,0) NOT NULL,
+  `message` text,
+  PRIMARY KEY (`version`)
+) ENGINE=mroonga DEFAULT CHARSET=utf8
+INSERT INTO releases (version, message) VALUES (1, "the first release!!!");
+INSERT INTO releases (version, message) VALUES (10, "10th release!");
+INSERT INTO releases (version, message) VALUES (999, "the last release!");
+SELECT * FROM releases;
+version	message
+1	the first release!!!
+10	10th release!
+999	the last release!
+SELECT * FROM releases WHERE version BETWEEN "1" AND "10";
+version	message
+1	the first release!!!
+10	10th release!
+DROP TABLE releases;

  Added: test/sql/suite/mroonga_storage/t/primary_key_decimal_without_fractional_seconds.test (+39 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/t/primary_key_decimal_without_fractional_seconds.test    2012-02-17 16:58:37 +0900 (5bb5964)
@@ -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 PRIMARY KEY,
+  message TEXT
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE releases;
+
+INSERT INTO releases (version, message) VALUES (1, "the first release!!!");
+INSERT INTO releases (version, message) VALUES (10, "10th release!");
+INSERT INTO releases (version, message) VALUES (999, "the last release!");
+
+SELECT * FROM releases;
+
+SELECT * FROM releases WHERE version BETWEEN "1" AND "10";
+
+DROP TABLE releases;
+
+--source include/have_mroonga_deinit.inc
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index