Kouhei Sutou
null+****@clear*****
Sat Aug 3 20:47:13 JST 2013
Kouhei Sutou 2013-08-03 20:47:13 +0900 (Sat, 03 Aug 2013) New Revision: 0131008127208bf04bdbbdd12f5c6e89ffc6dd93 https://github.com/groonga/groonga/commit/0131008127208bf04bdbbdd12f5c6e89ffc6dd93 Message: table_remove: add removable check to double array trie table Added files: test/command/suite/table_remove/double_array_trie/referenced/column_own.expected test/command/suite/table_remove/double_array_trie/referenced/column_own.test test/command/suite/table_remove/double_array_trie/referenced/column_scalar.expected test/command/suite/table_remove/double_array_trie/referenced/column_scalar.test test/command/suite/table_remove/double_array_trie/referenced/column_vector.expected test/command/suite/table_remove/double_array_trie/referenced/column_vector.test test/command/suite/table_remove/double_array_trie/referenced/table_double_trie_array.expected test/command/suite/table_remove/double_array_trie/referenced/table_double_trie_array.test test/command/suite/table_remove/double_array_trie/referenced/table_hash.expected test/command/suite/table_remove/double_array_trie/referenced/table_hash.test test/command/suite/table_remove/double_array_trie/referenced/table_patricia_trie.expected test/command/suite/table_remove/double_array_trie/referenced/table_patricia_trie.test Modified files: lib/db.c Modified: lib/db.c (+3 -0) =================================================================== --- lib/db.c 2013-08-03 20:41:36 +0900 (6c12ba4) +++ lib/db.c 2013-08-03 20:47:13 +0900 (7ba839e) @@ -6739,6 +6739,9 @@ static void _grn_obj_remove_dat(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/double_array_trie/referenced/column_own.expected (+7 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/column_own.expected 2013-08-03 20:47:13 +0900 (2f4def5) @@ -0,0 +1,7 @@ +table_create Names TABLE_DAT_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/double_array_trie/referenced/column_own.test (+6 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/column_own.test 2013-08-03 20:47:13 +0900 (3c0970f) @@ -0,0 +1,6 @@ +table_create Names TABLE_DAT_KEY ShortText +column_create Names nick_name COLUMN_SCALAR Names + +table_remove Names + +dump Added: test/command/suite/table_remove/double_array_trie/referenced/column_scalar.expected (+24 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/column_scalar.expected 2013-08-03 20:47:13 +0900 (4ae2674) @@ -0,0 +1,24 @@ +table_create Names TABLE_DAT_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_DAT_KEY ShortText +table_create Users TABLE_HASH_KEY ShortText +column_create Users name COLUMN_SCALAR Names + Added: test/command/suite/table_remove/double_array_trie/referenced/column_scalar.test (+7 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/column_scalar.test 2013-08-03 20:47:13 +0900 (5c05b74) @@ -0,0 +1,7 @@ +table_create Names TABLE_DAT_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/double_array_trie/referenced/column_vector.expected (+24 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/column_vector.expected 2013-08-03 20:47:13 +0900 (c70d9d9) @@ -0,0 +1,24 @@ +table_create Names TABLE_DAT_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_DAT_KEY ShortText +table_create Users TABLE_HASH_KEY ShortText +column_create Users name COLUMN_VECTOR Names + Added: test/command/suite/table_remove/double_array_trie/referenced/column_vector.test (+7 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/column_vector.test 2013-08-03 20:47:13 +0900 (3580657) @@ -0,0 +1,7 @@ +table_create Names TABLE_DAT_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/double_array_trie/referenced/table_double_trie_array.expected (+21 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/table_double_trie_array.expected 2013-08-03 20:47:13 +0900 (a815322) @@ -0,0 +1,21 @@ +table_create Names TABLE_DAT_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_DAT_KEY ShortText +table_create Users TABLE_DAT_KEY Names + Added: test/command/suite/table_remove/double_array_trie/referenced/table_double_trie_array.test (+6 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/table_double_trie_array.test 2013-08-03 20:47:13 +0900 (0ebb2ed) @@ -0,0 +1,6 @@ +table_create Names TABLE_DAT_KEY ShortText +table_create Users TABLE_DAT_KEY Names + +table_remove Names + +dump Added: test/command/suite/table_remove/double_array_trie/referenced/table_hash.expected (+21 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/table_hash.expected 2013-08-03 20:47:13 +0900 (4484667) @@ -0,0 +1,21 @@ +table_create Names TABLE_DAT_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_DAT_KEY ShortText +table_create Users TABLE_HASH_KEY Names + Added: test/command/suite/table_remove/double_array_trie/referenced/table_hash.test (+6 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/table_hash.test 2013-08-03 20:47:13 +0900 (ac15221) @@ -0,0 +1,6 @@ +table_create Names TABLE_DAT_KEY ShortText +table_create Users TABLE_HASH_KEY Names + +table_remove Names + +dump Added: test/command/suite/table_remove/double_array_trie/referenced/table_patricia_trie.expected (+21 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/table_patricia_trie.expected 2013-08-03 20:47:13 +0900 (b98ccf1) @@ -0,0 +1,21 @@ +table_create Names TABLE_DAT_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_DAT_KEY ShortText +table_create Users TABLE_PAT_KEY Names + Added: test/command/suite/table_remove/double_array_trie/referenced/table_patricia_trie.test (+6 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_remove/double_array_trie/referenced/table_patricia_trie.test 2013-08-03 20:47:13 +0900 (a1b1bf5) @@ -0,0 +1,6 @@ +table_create Names TABLE_DAT_KEY ShortText +table_create Users TABLE_PAT_KEY Names + +table_remove Names + +dump -------------- next part -------------- HTML����������������������������... 下載