Kouhei Sutou
null+****@clear*****
Sat Aug 3 20:50:46 JST 2013
Kouhei Sutou 2013-08-03 20:50:46 +0900 (Sat, 03 Aug 2013) New Revision: 94ae75f16cf3841d988e64ee5dadf0ed5994d597 https://github.com/groonga/groonga/commit/94ae75f16cf3841d988e64ee5dadf0ed5994d597 Message: table_remove: enable removable check for hash table Added files: test/command/suite/table_remove/hash/referenced/column_own.expected test/command/suite/table_remove/hash/referenced/column_own.test test/command/suite/table_remove/hash/referenced/column_scalar.expected test/command/suite/table_remove/hash/referenced/column_scalar.test test/command/suite/table_remove/hash/referenced/column_vector.expected test/command/suite/table_remove/hash/referenced/column_vector.test test/command/suite/table_remove/hash/referenced/table_double_trie_array.expected test/command/suite/table_remove/hash/referenced/table_double_trie_array.test test/command/suite/table_remove/hash/referenced/table_hash.expected test/command/suite/table_remove/hash/referenced/table_hash.test test/command/suite/table_remove/hash/referenced/table_patricia_trie.expected test/command/suite/table_remove/hash/referenced/table_patricia_trie.test Modified files: lib/db.c Modified: lib/db.c (+3 -0) =================================================================== --- lib/db.c 2013-08-03 20:47:50 +0900 (7ba839e) +++ lib/db.c 2013-08-03 20:50:46 +0900 (3bded91) @@ -6757,6 +6757,9 @@ static void _grn_obj_remove_hash(grn_ctx *ctx, grn_obj *obj, grn_obj *db, grn_id id, const char *path) { + if (!is_removable_table(ctx, obj, db)) { + return; + } remove_index(ctx, obj, GRN_HOOK_INSERT); remove_columns(ctx, obj); grn_obj_close(ctx, obj); Added: test/command/suite/table_remove/hash/referenced/column_own.expected (+7 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/column_own.expected 2013-08-03 20:50:46 +0900 (46c4915) @@ -0,0 +1,7 @@ +table_create Names TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Names nick_name COLUMN_SCALAR Names +[[0,0.0,0.0],true] +table_remove Names +[[0,0.0,0.0],true] +dump Added: test/command/suite/table_remove/hash/referenced/column_own.test (+6 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/column_own.test 2013-08-03 20:50:46 +0900 (f31fbb2) @@ -0,0 +1,6 @@ +table_create Names TABLE_HASH_KEY ShortText +column_create Names nick_name COLUMN_SCALAR Names + +table_remove Names + +dump Added: test/command/suite/table_remove/hash/referenced/column_scalar.expected (+24 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/column_scalar.expected 2013-08-03 20:50:46 +0900 (9231ab7) @@ -0,0 +1,24 @@ +table_create Names TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +table_create Users TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Users name COLUMN_SCALAR Names +[[0,0.0,0.0],true] +table_remove Names +[ + [ + [ + -2, + 0.0, + 0.0 + ], + "[table][remove] a column that references the table exists: <Users.name> -> <Names>" + ], + false +] +#|e| [table][remove] a column that references the table exists: <Users.name> -> <Names> +dump +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_HASH_KEY ShortText +column_create Users name COLUMN_SCALAR Names + Added: test/command/suite/table_remove/hash/referenced/column_scalar.test (+7 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/column_scalar.test 2013-08-03 20:50:46 +0900 (181bc48) @@ -0,0 +1,7 @@ +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_HASH_KEY ShortText +column_create Users name COLUMN_SCALAR Names + +table_remove Names + +dump Added: test/command/suite/table_remove/hash/referenced/column_vector.expected (+24 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/column_vector.expected 2013-08-03 20:50:46 +0900 (02cab2e) @@ -0,0 +1,24 @@ +table_create Names TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +table_create Users TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Users name COLUMN_VECTOR Names +[[0,0.0,0.0],true] +table_remove Names +[ + [ + [ + -2, + 0.0, + 0.0 + ], + "[table][remove] a column that references the table exists: <Users.name> -> <Names>" + ], + false +] +#|e| [table][remove] a column that references the table exists: <Users.name> -> <Names> +dump +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_HASH_KEY ShortText +column_create Users name COLUMN_VECTOR Names + Added: test/command/suite/table_remove/hash/referenced/column_vector.test (+7 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/column_vector.test 2013-08-03 20:50:46 +0900 (4716fee) @@ -0,0 +1,7 @@ +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_HASH_KEY ShortText +column_create Users name COLUMN_VECTOR Names + +table_remove Names + +dump Added: test/command/suite/table_remove/hash/referenced/table_double_trie_array.expected (+21 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/table_double_trie_array.expected 2013-08-03 20:50:46 +0900 (4199e52) @@ -0,0 +1,21 @@ +table_create Names TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +table_create Users TABLE_DAT_KEY Names +[[0,0.0,0.0],true] +table_remove Names +[ + [ + [ + -2, + 0.0, + 0.0 + ], + "[table][remove] a table that references the table exists: <Users._key> -> <Names>" + ], + false +] +#|e| [table][remove] a table that references the table exists: <Users._key> -> <Names> +dump +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_DAT_KEY Names + Added: test/command/suite/table_remove/hash/referenced/table_double_trie_array.test (+6 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/table_double_trie_array.test 2013-08-03 20:50:46 +0900 (5ac1710) @@ -0,0 +1,6 @@ +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_DAT_KEY Names + +table_remove Names + +dump Added: test/command/suite/table_remove/hash/referenced/table_hash.expected (+21 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/table_hash.expected 2013-08-03 20:50:46 +0900 (1ba45eb) @@ -0,0 +1,21 @@ +table_create Names TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +table_create Users TABLE_HASH_KEY Names +[[0,0.0,0.0],true] +table_remove Names +[ + [ + [ + -2, + 0.0, + 0.0 + ], + "[table][remove] a table that references the table exists: <Users._key> -> <Names>" + ], + false +] +#|e| [table][remove] a table that references the table exists: <Users._key> -> <Names> +dump +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_HASH_KEY Names + Added: test/command/suite/table_remove/hash/referenced/table_hash.test (+6 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/table_hash.test 2013-08-03 20:50:46 +0900 (ba60aac) @@ -0,0 +1,6 @@ +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_HASH_KEY Names + +table_remove Names + +dump Added: test/command/suite/table_remove/hash/referenced/table_patricia_trie.expected (+21 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/table_patricia_trie.expected 2013-08-03 20:50:46 +0900 (2ce2800) @@ -0,0 +1,21 @@ +table_create Names TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +table_create Users TABLE_PAT_KEY Names +[[0,0.0,0.0],true] +table_remove Names +[ + [ + [ + -2, + 0.0, + 0.0 + ], + "[table][remove] a table that references the table exists: <Users._key> -> <Names>" + ], + false +] +#|e| [table][remove] a table that references the table exists: <Users._key> -> <Names> +dump +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_PAT_KEY Names + Added: test/command/suite/table_remove/hash/referenced/table_patricia_trie.test (+6 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/hash/referenced/table_patricia_trie.test 2013-08-03 20:50:46 +0900 (ebdb77b) @@ -0,0 +1,6 @@ +table_create Names TABLE_HASH_KEY ShortText +table_create Users TABLE_PAT_KEY Names + +table_remove Names + +dump -------------- next part -------------- HTML����������������������������... Download