null+****@clear*****
null+****@clear*****
2011年 9月 23日 (金) 14:55:19 JST
Kouhei Sutou 2011-09-23 05:55:19 +0000 (Fri, 23 Sep 2011) New Revision: 0a62d650066ec33917f8878f0f0575f8142a2d3f Log: [storage][test] split hash index test for normal column. Added files: test/sql/groonga_storage/r/hash_index_normal_column_insert.result Copied files: test/sql/groonga_storage/t/hash_index_normal_column_insert.test (from test/sql/groonga_storage/t/hash.test) Modified files: test/sql/groonga_storage/r/hash.result test/sql/groonga_storage/t/hash.test Modified: test/sql/groonga_storage/r/hash.result (+0 -24) =================================================================== --- test/sql/groonga_storage/r/hash.result 2011-09-23 05:51:03 +0000 (d1c6ae2) +++ test/sql/groonga_storage/r/hash.result 2011-09-23 05:55:19 +0000 (b269c45) @@ -1,28 +1,4 @@ drop table if exists t1, t2, t3; -create table t1 (c1 int primary key, c2 int, index using hash (c2)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` int(11) NOT NULL, - `c2` int(11) DEFAULT NULL, - PRIMARY KEY (`c1`), - KEY `c2` (`c2`) USING HASH -) ENGINE=groonga DEFAULT CHARSET=latin1 -insert into t1 values (1, 100); -insert into t1 values (2, 101); -insert into t1 values (3, 102); -select * from t1; -c1 c2 -1 100 -2 101 -3 102 -flush tables; -select * from t1; -c1 c2 -1 100 -2 101 -3 102 -drop table t1; create table t1 (_id int, a int, primary key (_id) using hash); insert into t1 values(null, 100); ERROR 23000: Column '_id' cannot be null Added: test/sql/groonga_storage/r/hash_index_normal_column_insert.result (+25 -0) 100644 =================================================================== --- /dev/null +++ test/sql/groonga_storage/r/hash_index_normal_column_insert.result 2011-09-23 05:55:19 +0000 (fe14ad9) @@ -0,0 +1,25 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int, index using hash (c2)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`), + KEY `c2` (`c2`) USING HASH +) ENGINE=groonga DEFAULT CHARSET=latin1 +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +flush tables; +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +drop table t1; Modified: test/sql/groonga_storage/t/hash.test (+0 -10) =================================================================== --- test/sql/groonga_storage/t/hash.test 2011-09-23 05:51:03 +0000 (a97015b) +++ test/sql/groonga_storage/t/hash.test 2011-09-23 05:55:19 +0000 (2b42b84) @@ -20,16 +20,6 @@ drop table if exists t1, t2, t3; --enable_warnings -create table t1 (c1 int primary key, c2 int, index using hash (c2)); -show create table t1; -insert into t1 values (1, 100); -insert into t1 values (2, 101); -insert into t1 values (3, 102); -select * from t1; -flush tables; -select * from t1; -drop table t1; - # _id with hash index create table t1 (_id int, a int, primary key (_id) using hash); --error 1048 Copied: test/sql/groonga_storage/t/hash_index_normal_column_insert.test (+0 -34) 55% =================================================================== --- test/sql/groonga_storage/t/hash.test 2011-09-23 05:51:03 +0000 (a97015b) +++ test/sql/groonga_storage/t/hash_index_normal_column_insert.test 2011-09-23 05:55:19 +0000 (2463577) @@ -30,38 +30,4 @@ flush tables; select * from t1; drop table t1; -# _id with hash index -create table t1 (_id int, a int, primary key (_id) using hash); ---error 1048 -insert into t1 values(null, 100); -insert into t1 values(1,100); -insert into t1 values(1,100); -insert into t1 values(1,100); -insert into t1 values(1,100); -select * from t1; -select * from t1 where _id = 2; -select * from t1 where _id = 20; -drop table t1; - -create table t1 (_id int, a int, unique key (_id) using hash); -insert into t1 values(null, 100); -insert into t1 values(null, 100); -insert into t1 values(null, 100); -insert into t1 values(null, 100); -select * from t1; -select * from t1 where _id = 2; -select * from t1 where _id = 20; -drop table t1; - - -create table t1 (_id int, a int, key (_id) using hash); -insert into t1 values(null, 100); -insert into t1 values(null, 100); -insert into t1 values(null, 100); -insert into t1 values(null, 100); -select * from t1; -select * from t1 where _id = 2; -select * from t1 where _id = 20; -drop table t1; - --source suite/groonga_include/groonga_deinit.inc