null+****@clear*****
null+****@clear*****
2012年 5月 28日 (月) 23:54:22 JST
Kouhei Sutou 2012-05-28 23:54:22 +0900 (Mon, 28 May 2012)
New Revision: 29674e558be33355cdef309539e59117105a3417
Log:
test: add a test about DROP KEY
Added files:
test/sql/suite/mroonga_storage/r/alter_table_drop_key_multiple_column_with_data.result
test/sql/suite/mroonga_storage/t/alter_table_drop_key_multiple_column_with_data.test
Added: test/sql/suite/mroonga_storage/r/alter_table_drop_key_multiple_column_with_data.result (+33 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/r/alter_table_drop_key_multiple_column_with_data.result 2012-05-28 23:54:22 +0900 (640d51e)
@@ -0,0 +1,33 @@
+DROP TABLE IF EXISTS scores;
+SET NAMES UTF8;
+CREATE TABLE scores (
+id BIGINT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL,
+name CHAR(30) NOT NULL,
+score INT NOT NULL,
+KEY property (name, score)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE scores;
+Table Create Table
+scores CREATE TABLE `scores` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` char(30) NOT NULL,
+ `score` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `property` (`name`,`score`)
+) ENGINE=mroonga DEFAULT CHARSET=utf8
+INSERT INTO scores (name, score) VALUES("Taro Yamada", 29);
+INSERT INTO scores (name, score) VALUES("Taro Yamada", -12);
+INSERT INTO scores (name, score) VALUES("Jiro Yamada", 27);
+INSERT INTO scores (name, score) VALUES("Taro Yamada", 10);
+SELECT * FROM scores
+WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29);
+id name score
+2 Taro Yamada -12
+4 Taro Yamada 10
+ALTER TABLE scores DROP KEY property;
+SELECT * FROM scores
+WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29);
+id name score
+2 Taro Yamada -12
+4 Taro Yamada 10
+DROP TABLE scores;
Added: test/sql/suite/mroonga_storage/t/alter_table_drop_key_multiple_column_with_data.test (+46 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/t/alter_table_drop_key_multiple_column_with_data.test 2012-05-28 23:54:22 +0900 (bf4bd83)
@@ -0,0 +1,46 @@
+# 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/not_embedded.inc
+--source include/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS scores;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE scores (
+ id BIGINT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ name CHAR(30) NOT NULL,
+ score INT NOT NULL,
+ KEY property (name, score)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE scores;
+
+INSERT INTO scores (name, score) VALUES("Taro Yamada", 29);
+INSERT INTO scores (name, score) VALUES("Taro Yamada", -12);
+INSERT INTO scores (name, score) VALUES("Jiro Yamada", 27);
+INSERT INTO scores (name, score) VALUES("Taro Yamada", 10);
+SELECT * FROM scores
+ WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29);
+
+ALTER TABLE scores DROP KEY property;
+SELECT * FROM scores
+ WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29);
+
+DROP TABLE scores;
+
+--source include/have_mroonga_deinit.inc