Kouhei Sutou
null+****@clear*****
Tue Dec 25 17:28:46 JST 2012
Kouhei Sutou 2012-12-25 17:28:46 +0900 (Tue, 25 Dec 2012) New Revision: 2f004c22bb58c573290081dfbcce2deae69d0d99 https://github.com/groonga/groonga/commit/2f004c22bb58c573290081dfbcce2deae69d0d99 Log: Fix wrong ID for nested index Modified files: lib/db.c test/command/suite/select/index/nested/double_array_tire.expected test/command/suite/select/index/nested/double_array_tire.test test/command/suite/select/index/nested/hash.expected test/command/suite/select/index/nested/hash.test test/command/suite/select/index/nested/patricia_trie.expected test/command/suite/select/index/nested/patricia_trie.test Modified: lib/db.c (+2 -2) =================================================================== --- lib/db.c 2012-12-25 17:14:12 +0900 (9acd8be) +++ lib/db.c 2012-12-25 17:28:46 +0900 (03cd8f5) @@ -2905,7 +2905,7 @@ grn_obj_search_accessor(grn_ctx *ctx, grn_obj *obj, grn_obj *query, break; } } else { - grn_obj *tid; + grn_id *tid; grn_obj *domain; grn_obj *next_res; grn_operator next_op; @@ -2936,7 +2936,7 @@ grn_obj_search_accessor(grn_ctx *ctx, grn_obj *obj, grn_obj *query, } else { char key[GRN_TABLE_MAX_KEY_SIZE]; int key_len; - key_len = grn_table_get_key(ctx, domain, id, + key_len = grn_table_get_key(ctx, domain, *tid, key, GRN_TABLE_MAX_KEY_SIZE); rc = grn_ii_sel(ctx, (grn_ii *)index, key, key_len, (grn_hash *)next_res, next_op, &next_optarg); Modified: test/command/suite/select/index/nested/double_array_tire.expected (+13 -5) =================================================================== --- test/command/suite/select/index/nested/double_array_tire.expected 2012-12-25 17:14:12 +0900 (8fb726f) +++ test/command/suite/select/index/nested/double_array_tire.expected 2012-12-25 17:28:46 +0900 (2d4741f) @@ -20,17 +20,19 @@ load --table Comments [ {"_key": "1-1", "content": "I'm using groonga too!"}, {"_key": "2-1", "content": "I'm using groonga and mroonga!"}, -{"_key": "1-2", "content": "I'm using mroonga too!"} +{"_key": "3-1", "content": "I'm using mroonga too!"}, +{"_key": "4-1", "content": "I'm using groonga and rroonga too!"} ] -[[0,0.0,0.0],3] +[[0,0.0,0.0],4] load --table Articles [ ["_key", "content", "comment"], ["groonga-is-fast", "Groonga is fast!", "1-1"], ["groonga-is-useful", "Groonga is useful!"], -["mroonga-is-fast", "Mroonga is fast!", "1-2"] +["mroonga-is-fast", "Mroonga is fast!", "3-1"], +["rroonga-is-fast", "Rroonga is fast!", "4-1"] ] -[[0,0.0,0.0],2] +[[0,0.0,0.0],3] select Articles --match_columns comment.content --query groonga --output_columns "_id, _score, *" [ [ @@ -41,7 +43,7 @@ select Articles --match_columns comment.content --query groonga --output_colum [ [ [ - 1 + 2 ], [ [ @@ -66,6 +68,12 @@ select Articles --match_columns comment.content --query groonga --output_colum 1, "1-1", "Groonga is fast!" + ], + [ + 3, + 1, + "4-1", + "Rroonga is fast!" ] ] ] Modified: test/command/suite/select/index/nested/double_array_tire.test (+4 -2) =================================================================== --- test/command/suite/select/index/nested/double_array_tire.test 2012-12-25 17:14:12 +0900 (c626f0b) +++ test/command/suite/select/index/nested/double_array_tire.test 2012-12-25 17:28:46 +0900 (9d20250) @@ -18,7 +18,8 @@ load --table Comments [ {"_key": "1-1", "content": "I'm using groonga too!"}, {"_key": "2-1", "content": "I'm using groonga and mroonga!"}, -{"_key": "1-2", "content": "I'm using mroonga too!"} +{"_key": "3-1", "content": "I'm using mroonga too!"}, +{"_key": "4-1", "content": "I'm using groonga and rroonga too!"} ] load --table Articles @@ -26,7 +27,8 @@ load --table Articles ["_key", "content", "comment"], ["groonga-is-fast", "Groonga is fast!", "1-1"], ["groonga-is-useful", "Groonga is useful!"], -["mroonga-is-fast", "Mroonga is fast!", "1-2"] +["mroonga-is-fast", "Mroonga is fast!", "3-1"], +["rroonga-is-fast", "Rroonga is fast!", "4-1"] ] select Articles --match_columns comment.content --query groonga \ Modified: test/command/suite/select/index/nested/hash.expected (+13 -5) =================================================================== --- test/command/suite/select/index/nested/hash.expected 2012-12-25 17:14:12 +0900 (dcf6534) +++ test/command/suite/select/index/nested/hash.expected 2012-12-25 17:28:46 +0900 (4d7b800) @@ -20,17 +20,19 @@ load --table Comments [ {"_key": "1-1", "content": "I'm using groonga too!"}, {"_key": "2-1", "content": "I'm using groonga and mroonga!"}, -{"_key": "1-2", "content": "I'm using mroonga too!"} +{"_key": "3-1", "content": "I'm using mroonga too!"}, +{"_key": "4-1", "content": "I'm using groonga and rroonga too!"} ] -[[0,0.0,0.0],3] +[[0,0.0,0.0],4] load --table Articles [ ["_key", "content", "comment"], ["groonga-is-fast", "Groonga is fast!", "1-1"], ["groonga-is-useful", "Groonga is useful!"], -["mroonga-is-fast", "Mroonga is fast!", "1-2"] +["mroonga-is-fast", "Mroonga is fast!", "3-1"], +["rroonga-is-fast", "Rroonga is fast!", "4-1"] ] -[[0,0.0,0.0],2] +[[0,0.0,0.0],3] select Articles --match_columns comment.content --query groonga --output_columns "_id, _score, *" [ [ @@ -41,7 +43,7 @@ select Articles --match_columns comment.content --query groonga --output_colum [ [ [ - 1 + 2 ], [ [ @@ -66,6 +68,12 @@ select Articles --match_columns comment.content --query groonga --output_colum 1, "1-1", "Groonga is fast!" + ], + [ + 3, + 1, + "4-1", + "Rroonga is fast!" ] ] ] Modified: test/command/suite/select/index/nested/hash.test (+4 -2) =================================================================== --- test/command/suite/select/index/nested/hash.test 2012-12-25 17:14:12 +0900 (6a7553b) +++ test/command/suite/select/index/nested/hash.test 2012-12-25 17:28:46 +0900 (63a671a) @@ -18,7 +18,8 @@ load --table Comments [ {"_key": "1-1", "content": "I'm using groonga too!"}, {"_key": "2-1", "content": "I'm using groonga and mroonga!"}, -{"_key": "1-2", "content": "I'm using mroonga too!"} +{"_key": "3-1", "content": "I'm using mroonga too!"}, +{"_key": "4-1", "content": "I'm using groonga and rroonga too!"} ] load --table Articles @@ -26,7 +27,8 @@ load --table Articles ["_key", "content", "comment"], ["groonga-is-fast", "Groonga is fast!", "1-1"], ["groonga-is-useful", "Groonga is useful!"], -["mroonga-is-fast", "Mroonga is fast!", "1-2"] +["mroonga-is-fast", "Mroonga is fast!", "3-1"], +["rroonga-is-fast", "Rroonga is fast!", "4-1"] ] select Articles --match_columns comment.content --query groonga \ Modified: test/command/suite/select/index/nested/patricia_trie.expected (+13 -5) =================================================================== --- test/command/suite/select/index/nested/patricia_trie.expected 2012-12-25 17:14:12 +0900 (94f51bd) +++ test/command/suite/select/index/nested/patricia_trie.expected 2012-12-25 17:28:46 +0900 (9b557bf) @@ -20,17 +20,19 @@ load --table Comments [ {"_key": "1-1", "content": "I'm using groonga too!"}, {"_key": "2-1", "content": "I'm using groonga and mroonga!"}, -{"_key": "1-2", "content": "I'm using mroonga too!"} +{"_key": "3-1", "content": "I'm using mroonga too!"}, +{"_key": "4-1", "content": "I'm using groonga and rroonga too!"} ] -[[0,0.0,0.0],3] +[[0,0.0,0.0],4] load --table Articles [ ["_key", "content", "comment"], ["groonga-is-fast", "Groonga is fast!", "1-1"], ["groonga-is-useful", "Groonga is useful!"], -["mroonga-is-fast", "Mroonga is fast!", "1-2"] +["mroonga-is-fast", "Mroonga is fast!", "3-1"], +["rroonga-is-fast", "Rroonga is fast!", "4-1"] ] -[[0,0.0,0.0],2] +[[0,0.0,0.0],3] select Articles --match_columns comment.content --query groonga --output_columns "_id, _score, *" [ [ @@ -41,7 +43,7 @@ select Articles --match_columns comment.content --query groonga --output_colum [ [ [ - 1 + 2 ], [ [ @@ -66,6 +68,12 @@ select Articles --match_columns comment.content --query groonga --output_colum 1, "1-1", "Groonga is fast!" + ], + [ + 3, + 1, + "4-1", + "Rroonga is fast!" ] ] ] Modified: test/command/suite/select/index/nested/patricia_trie.test (+4 -2) =================================================================== --- test/command/suite/select/index/nested/patricia_trie.test 2012-12-25 17:14:12 +0900 (a84dc16) +++ test/command/suite/select/index/nested/patricia_trie.test 2012-12-25 17:28:46 +0900 (cc307d4) @@ -18,7 +18,8 @@ load --table Comments [ {"_key": "1-1", "content": "I'm using groonga too!"}, {"_key": "2-1", "content": "I'm using groonga and mroonga!"}, -{"_key": "1-2", "content": "I'm using mroonga too!"} +{"_key": "3-1", "content": "I'm using mroonga too!"}, +{"_key": "4-1", "content": "I'm using groonga and rroonga too!"} ] load --table Articles @@ -26,7 +27,8 @@ load --table Articles ["_key", "content", "comment"], ["groonga-is-fast", "Groonga is fast!", "1-1"], ["groonga-is-useful", "Groonga is useful!"], -["mroonga-is-fast", "Mroonga is fast!", "1-2"] +["mroonga-is-fast", "Mroonga is fast!", "3-1"], +["rroonga-is-fast", "Rroonga is fast!", "4-1"] ] select Articles --match_columns comment.content --query groonga \ -------------- next part -------------- HTML����������������������������... Télécharger