Daijiro MORI
null+****@clear*****
Wed May 22 16:57:45 JST 2013
Daijiro MORI 2013-05-22 16:57:45 +0900 (Wed, 22 May 2013) New Revision: 8f8631c20d6b6f3aee965b445211a9de3055c618 https://github.com/groonga/groonga/commit/8f8631c20d6b6f3aee965b445211a9de3055c618 Message: Distinquish whether the table is actually grouped or not. Modified files: lib/db.c Modified: lib/db.c (+9 -1) =================================================================== --- lib/db.c 2013-05-22 15:17:45 +0900 (7bbd7b5) +++ lib/db.c 2013-05-22 16:57:45 +0900 (a105e1e) @@ -34,6 +34,12 @@ #define NEXT_ADDR(p) (((byte *)(p)) + sizeof *(p)) +#define GRN_TABLE_GROUPED 1 +#define GRN_TABLE_IS_GROUPED(table)\ + (((grn_hash *)(table))->obj.header.impl_flags & GRN_TABLE_GROUPED) +#define GRN_TABLE_GROUPED_ON(table)\ + (((grn_hash *)(table))->obj.header.impl_flags |= GRN_TABLE_GROUPED) + #define WITH_NORMALIZE(table,key,key_size,block) do {\ if ((table)->normalizer && key && key_size > 0) {\ grn_obj *nstr;\ @@ -2897,6 +2903,7 @@ grn_table_group_with_range_gap(grn_ctx *ctx, grn_obj *table, return 0; } grn_table_cursor_close(ctx, tc); + GRN_TABLE_GROUPED_ON(res); return 1; } } @@ -3016,6 +3023,7 @@ grn_table_group(grn_ctx *ctx, grn_obj *table, } grn_obj_close(ctx, &bulk); } + GRN_TABLE_GROUPED_ON(results); exit : GRN_API_RETURN(rc); } @@ -4050,7 +4058,7 @@ grn_obj_get_accessor(grn_ctx *ctx, grn_obj *obj, const char *name, unsigned int for (rp = &res; !done; rp = &(*rp)->next) { *rp = accessor_new(ctx); (*rp)->obj = obj; - if (DB_OBJ(obj)->header.flags & GRN_OBJ_WITH_SUBREC) { + if (GRN_TABLE_IS_GROUPED(obj)) { (*rp)->action = GRN_ACCESSOR_GET_NSUBRECS; done++; } else { -------------- next part -------------- HTML����������������������������... ダウンロード