Navigation Menu

Skip to content

Commit

Permalink
Fix wrong return value
Browse files Browse the repository at this point in the history
We should not use grn_rc for error code in MySQL. grn_rc should be
converted to MySQL error code.
  • Loading branch information
kou committed Aug 22, 2014
1 parent 784d72b commit b899b2a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ha_mroonga.cpp
Expand Up @@ -4408,12 +4408,14 @@ int ha_mroonga::wrapper_delete_index(const char *name, MRN_SHARE *tmp_share,
}

grn_obj *table = grn_ctx_get(ctx, table_name, strlen(table_name));
if (!ctx->rc) {
grn_obj_remove(ctx, table);
}
if (ctx->rc) {
error = ER_CANT_OPEN_FILE;
my_message(error, ctx->errbuf, MYF(0));
DBUG_RETURN(error);
}
error = grn_obj_remove(ctx, table);
DBUG_RETURN(error);
}

Expand Down Expand Up @@ -4441,12 +4443,14 @@ int ha_mroonga::storage_delete_table(const char *name, MRN_SHARE *tmp_share,
}

grn_obj *table_obj = grn_ctx_get(ctx, table_name, strlen(table_name));
if (!ctx->rc) {
grn_obj_remove(ctx, table_obj);
}
if (ctx->rc) {
error = ER_CANT_OPEN_FILE;
my_message(error, ctx->errbuf, MYF(0));
DBUG_RETURN(error);
}
error = grn_obj_remove(ctx, table_obj);
DBUG_RETURN(error);
}

Expand Down

0 comments on commit b899b2a

Please sign in to comment.