Navigation Menu

Skip to content

Commit

Permalink
Initialize value size by size of value type for no subrec table
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 19, 2013
1 parent 321183e commit 89642a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/db.c
Expand Up @@ -674,6 +674,8 @@ calc_rec_size(grn_obj_flags flags, uint32_t max_n_subrecs, uint32_t range_size,
}
*value_size = (uintptr_t)GRN_RSET_SUBRECS_NTH((((grn_rset_recinfo *)0)->subrecs),
*subrec_size, max_n_subrecs);
} else {
*value_size = range_size;
}
}

Expand Down Expand Up @@ -731,7 +733,7 @@ grn_table_create_with_max_n_subrecs(grn_ctx *ctx, const char *name,
{
grn_id id;
grn_id domain = GRN_ID_NIL, range = GRN_ID_NIL;
uint32_t key_size, value_size, range_size = 0;
uint32_t key_size, value_size = 0, range_size = 0;
uint8_t subrec_size, subrec_offset;
grn_obj *res = NULL;
grn_obj *db;
Expand Down

0 comments on commit 89642a3

Please sign in to comment.