null+****@clear*****
null+****@clear*****
2011年 9月 23日 (金) 16:48:46 JST
Kouhei Sutou 2011-09-23 07:48:46 +0000 (Fri, 23 Sep 2011) New Revision: 2f62ba59e884e8476e922d3ed5573c6f40678a2d Log: [storage][test] split tests for primary hash index. Added files: test/sql/groonga_storage/r/hash_index_id_primary.result Copied files: test/sql/groonga_storage/t/hash_index_id_primary.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 -27) =================================================================== --- test/sql/groonga_storage/r/hash.result 2011-09-23 05:55:19 +0000 (b269c45) +++ test/sql/groonga_storage/r/hash.result 2011-09-23 07:48:46 +0000 (cbde2a9) @@ -1,31 +1,4 @@ drop table if exists t1, t2, t3; -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 -insert into t1 values(1,100); -Warnings: -Warning 1265 data truncated for _id column -insert into t1 values(1,100); -Warnings: -Warning 1265 data truncated for _id column -insert into t1 values(1,100); -Warnings: -Warning 1265 data truncated for _id column -insert into t1 values(1,100); -Warnings: -Warning 1265 data truncated for _id column -select * from t1; -_id a -1 100 -2 100 -3 100 -4 100 -select * from t1 where _id = 2; -_id a -2 100 -select * from t1 where _id = 20; -_id a -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); Added: test/sql/groonga_storage/r/hash_index_id_primary.result (+28 -0) 100644 =================================================================== --- /dev/null +++ test/sql/groonga_storage/r/hash_index_id_primary.result 2011-09-23 07:48:46 +0000 (f2adfb1) @@ -0,0 +1,28 @@ +drop table if exists t1, t2, t3; +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 +insert into t1 values(1,100); +Warnings: +Warning 1265 data truncated for _id column +insert into t1 values(1,100); +Warnings: +Warning 1265 data truncated for _id column +insert into t1 values(1,100); +Warnings: +Warning 1265 data truncated for _id column +insert into t1 values(1,100); +Warnings: +Warning 1265 data truncated for _id column +select * from t1; +_id a +1 100 +2 100 +3 100 +4 100 +select * from t1 where _id = 2; +_id a +2 100 +select * from t1 where _id = 20; +_id a +drop table t1; Modified: test/sql/groonga_storage/t/hash.test (+0 -13) =================================================================== --- test/sql/groonga_storage/t/hash.test 2011-09-23 05:55:19 +0000 (2b42b84) +++ test/sql/groonga_storage/t/hash.test 2011-09-23 07:48:46 +0000 (5a2bbe8) @@ -20,19 +20,6 @@ drop table if exists t1, t2, t3; --enable_warnings -# _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); Copied: test/sql/groonga_storage/t/hash_index_id_primary.test (+0 -22) 67% =================================================================== --- test/sql/groonga_storage/t/hash.test 2011-09-23 05:55:19 +0000 (2b42b84) +++ test/sql/groonga_storage/t/hash_index_id_primary.test 2011-09-23 07:48:46 +0000 (3f685ac) @@ -20,7 +20,6 @@ drop table if exists t1, t2, t3; --enable_warnings -# _id with hash index create table t1 (_id int, a int, primary key (_id) using hash); --error 1048 insert into t1 values(null, 100); @@ -33,25 +32,4 @@ 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