Navigation Menu

Skip to content

Commit

Permalink
Don't touch on error
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 26, 2015
1 parent c04a933 commit 200a753
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/db.c
Expand Up @@ -1783,7 +1783,9 @@ grn_table_delete(grn_ctx *ctx, grn_obj *table, const void *key, unsigned int key
});
break;
}
grn_obj_touch(ctx, table, NULL);
if (rc == GRN_SUCCESS) {
grn_obj_touch(ctx, table, NULL);
}
}
}
exit :
Expand Down Expand Up @@ -1842,7 +1844,9 @@ grn_table_delete_by_id(grn_ctx *ctx, grn_obj *table, grn_id id)
} else {
rc = _grn_table_delete_by_id(ctx, table, id, NULL);
}
grn_obj_touch(ctx, table, NULL);
if (rc == GRN_SUCCESS) {
grn_obj_touch(ctx, table, NULL);
}
GRN_API_RETURN(rc);
}

Expand Down Expand Up @@ -1946,7 +1950,9 @@ grn_table_truncate(grn_ctx *ctx, grn_obj *table)
grn_obj_set_info(ctx, table, GRN_INFO_NORMALIZER, normalizer);
grn_obj_set_info(ctx, table, GRN_INFO_TOKEN_FILTERS, &token_filters);
GRN_OBJ_FIN(ctx, &token_filters);
grn_obj_touch(ctx, table, NULL);
if (rc == GRN_SUCCESS) {
grn_obj_touch(ctx, table, NULL);
}
}
exit :
GRN_API_RETURN(rc);
Expand Down

0 comments on commit 200a753

Please sign in to comment.