null+****@clear*****
null+****@clear*****
2011年 9月 28日 (水) 17:50:56 JST
Kouhei Sutou 2011-09-28 08:50:56 +0000 (Wed, 28 Sep 2011) New Revision: 872dafb8cbeaec1d1e23cf82b3d7bc06350a6b15 Log: [test][storage] split _id value update test. Added files: test/sql/groonga_storage/r/update_virtual_column.result Copied files: test/sql/groonga_storage/t/update_virtual_column.test (from test/sql/groonga_storage/t/update.test) Modified files: test/sql/groonga_storage/r/update.result test/sql/groonga_storage/t/update.test Modified: test/sql/groonga_storage/r/update.result (+0 -27) =================================================================== --- test/sql/groonga_storage/r/update.result 2011-09-28 08:49:19 +0000 (0ef57fb) +++ test/sql/groonga_storage/r/update.result 2011-09-28 08:50:56 +0000 (74864c4) @@ -1,31 +1,4 @@ drop table if exists t1, t2, t3; -create table t1 (c1 int, _id int); -insert into t1 values(1,null); -insert into t1 values(2,null); -insert into t1 values(3,null); -select * from t1; -c1 _id -1 1 -2 2 -3 3 -set sql_mode=""; -update t1 set _id = 10 where c1 = 1; -Warnings: -Warning 1265 data truncated for _id column -select * from t1; -c1 _id -1 1 -2 2 -3 3 -set sql_mode="strict_all_tables"; -update t1 set _id = 11 where c1 = 1; -ERROR 22001: cannot update value to _id column -select * from t1; -c1 _id -1 1 -2 2 -3 3 -drop table t1; create table t1 (_id int, c1 int, unique key (_id) using hash); insert into t1 values(null, 100); insert into t1 values(null, 100); Added: test/sql/groonga_storage/r/update_virtual_column.result (+28 -0) 100644 =================================================================== --- /dev/null +++ test/sql/groonga_storage/r/update_virtual_column.result 2011-09-28 08:50:56 +0000 (e3c015e) @@ -0,0 +1,28 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int, _id int); +insert into t1 values(1,null); +insert into t1 values(2,null); +insert into t1 values(3,null); +select * from t1; +c1 _id +1 1 +2 2 +3 3 +set sql_mode=""; +update t1 set _id = 10 where c1 = 1; +Warnings: +Warning 1265 data truncated for _id column +select * from t1; +c1 _id +1 1 +2 2 +3 3 +set sql_mode="strict_all_tables"; +update t1 set _id = 11 where c1 = 1; +ERROR 22001: cannot update value to _id column +select * from t1; +c1 _id +1 1 +2 2 +3 3 +drop table t1; Modified: test/sql/groonga_storage/t/update.test (+0 -16) =================================================================== --- test/sql/groonga_storage/t/update.test 2011-09-28 08:49:19 +0000 (ff20f1f) +++ test/sql/groonga_storage/t/update.test 2011-09-28 08:50:56 +0000 (960b20d) @@ -20,22 +20,6 @@ drop table if exists t1, t2, t3; --enable_warnings -# for virtual columns -create table t1 (c1 int, _id int); -insert into t1 values(1,null); -insert into t1 values(2,null); -insert into t1 values(3,null); -select * from t1; -set sql_mode=""; -# warning 1265 -update t1 set _id = 10 where c1 = 1; -select * from t1; -set sql_mode="strict_all_tables"; ---error 1406 -update t1 set _id = 11 where c1 = 1; -select * from t1; -drop table t1; - # _id and hash index create table t1 (_id int, c1 int, unique key (_id) using hash); insert into t1 values(null, 100); Copied: test/sql/groonga_storage/t/update_virtual_column.test (+0 -21) 68% =================================================================== --- test/sql/groonga_storage/t/update.test 2011-09-28 08:49:19 +0000 (ff20f1f) +++ test/sql/groonga_storage/t/update_virtual_column.test 2011-09-28 08:50:56 +0000 (45038cf) @@ -36,25 +36,4 @@ update t1 set _id = 11 where c1 = 1; select * from t1; drop table t1; -# _id and hash index -create table t1 (_id int, c1 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; -update t1 set c1 = 200 where _id = 2; -select * from t1; -drop table t1; - -create table t1 (_id int, c1 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; -update t1 set c1 = 200 where _id = 2; -select * from t1; -drop table t1; - --source suite/groonga_include/groonga_deinit.inc