null+****@clear*****
null+****@clear*****
2011年 12月 30日 (金) 17:03:32 JST
Kouhei Sutou 2011-12-30 17:03:32 +0900 (Fri, 30 Dec 2011)
New Revision: 56a2d740f20d4128d9bc1de3dc54f762181cf49f
Log:
[test] add tests for DROP COLUMN.
Added files:
test/sql/suite/mroonga_storage/r/alter_table_drop_column.result
test/sql/suite/mroonga_storage/t/alter_table_drop_column.test
test/sql/suite/mroonga_wrapper/r/alter_table_drop_column.result
test/sql/suite/mroonga_wrapper/t/alter_table_drop_column.test
Added: test/sql/suite/mroonga_storage/r/alter_table_drop_column.result (+37 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/r/alter_table_drop_column.result 2011-12-30 17:03:32 +0900 (ec29e94)
@@ -0,0 +1,37 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+body TEXT
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` text,
+ `body` text,
+ PRIMARY KEY (`id`)
+) ENGINE=mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+SELECT * FROM diaries;
+id title body
+1 survey will start groonga!
+ALTER TABLE diaries DROP COLUMN body;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` text,
+ PRIMARY KEY (`id`)
+) ENGINE=mroonga DEFAULT CHARSET=utf8
+SELECT * FROM diaries;
+id title
+1 survey
+INSERT INTO diaries (title) values ("groonga (1)");
+INSERT INTO diaries (title) values ("groonga (2)");
+SELECT * FROM diaries;
+id title
+1 survey
+2 groonga (1)
+3 groonga (2)
+DROP TABLE diaries;
Added: test/sql/suite/mroonga_storage/t/alter_table_drop_column.test (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/t/alter_table_drop_column.test 2011-12-30 17:03:32 +0900 (45ed7d9)
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 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
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ body TEXT
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+SELECT * FROM diaries;
+
+ALTER TABLE diaries DROP COLUMN body;
+SHOW CREATE TABLE diaries;
+SELECT * FROM diaries;
+
+INSERT INTO diaries (title) values ("groonga (1)");
+INSERT INTO diaries (title) values ("groonga (2)");
+SELECT * FROM diaries;
+
+DROP TABLE diaries;
+
+--source include/have_mroonga_deinit.inc
Added: test/sql/suite/mroonga_wrapper/r/alter_table_drop_column.result (+37 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_wrapper/r/alter_table_drop_column.result 2011-12-30 17:03:32 +0900 (e258a8f)
@@ -0,0 +1,37 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+body TEXT
+) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"';
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` text,
+ `body` text,
+ PRIMARY KEY (`id`)
+) ENGINE=mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+SELECT * FROM diaries;
+id title body
+1 survey will start groonga!
+ALTER TABLE diaries DROP COLUMN body;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` text,
+ PRIMARY KEY (`id`)
+) ENGINE=mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'
+SELECT * FROM diaries;
+id title
+1 survey
+INSERT INTO diaries (title) values ("groonga (1)");
+INSERT INTO diaries (title) values ("groonga (2)");
+SELECT * FROM diaries;
+id title
+1 survey
+2 groonga (1)
+3 groonga (2)
+DROP TABLE diaries;
Added: test/sql/suite/mroonga_wrapper/t/alter_table_drop_column.test (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_wrapper/t/alter_table_drop_column.test 2011-12-30 17:03:32 +0900 (283e2da)
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 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
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ body TEXT
+) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"';
+SHOW CREATE TABLE diaries;
+
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+SELECT * FROM diaries;
+
+ALTER TABLE diaries DROP COLUMN body;
+SHOW CREATE TABLE diaries;
+SELECT * FROM diaries;
+
+INSERT INTO diaries (title) values ("groonga (1)");
+INSERT INTO diaries (title) values ("groonga (2)");
+SELECT * FROM diaries;
+
+DROP TABLE diaries;
+
+--source include/have_mroonga_deinit.inc