Navigation Menu

Skip to content

Commit

Permalink
show error message when creating a table for matched records
Browse files Browse the repository at this point in the history
When indexes are broken, there is a case that the value of
 matched_record_keys is null.
This commit shows error message for such a case.
  • Loading branch information
kenhys committed Jun 6, 2017
1 parent 3fa72e1 commit 13858df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ha_mroonga.cpp
Expand Up @@ -8705,6 +8705,14 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key)
matched_record_keys = grn_table_create(ctx, NULL, 0, NULL,
GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
grn_table, 0);
if (!matched_record_keys) {
char error_message[MRN_MESSAGE_BUFFER_SIZE];
snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE,
"failed to create a table for matched record: <%s>",
ctx->errbuf);
my_message(ER_ERROR_ON_READ, error_message, MYF(0));
GRN_LOG(ctx, GRN_LOG_ERROR, "%s", error_message);
}
}

grn_table_sort_key *sort_keys = NULL;
Expand Down

0 comments on commit 13858df

Please sign in to comment.