[Groonga-commit] groonga/groonga at 663165a [master] delete: don't ignore error

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jul 5 17:36:37 JST 2016


Kouhei Sutou	2016-07-05 17:36:37 +0900 (Tue, 05 Jul 2016)

  New Revision: 663165ab9c70db7797926f4bf66f41c3621eb908
  https://github.com/groonga/groonga/commit/663165ab9c70db7797926f4bf66f41c3621eb908

  Message:
    delete: don't ignore error
    
    If "delete --filter XXX" is used and grn_table_delete_by_id() returns no
    GRN_SUCCESS rc, the rc is ignored without this change.

  Modified files:
    lib/proc.c

  Modified: lib/proc.c (+5 -1)
===================================================================
--- lib/proc.c    2016-07-02 22:16:20 +0900 (2fdf0ab)
+++ lib/proc.c    2016-07-05 17:36:37 +0900 (5fcbe37)
@@ -546,7 +546,11 @@ proc_delete(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
         GRN_TABLE_EACH(ctx, records, GRN_ID_NIL, GRN_ID_NIL,
                        result_id, &key, NULL, NULL, {
           grn_id id = *(grn_id *)key;
-          grn_table_delete_by_id(ctx, table, id);
+          grn_rc sub_rc;
+          sub_rc = grn_table_delete_by_id(ctx, table, id);
+          if (rc == GRN_SUCCESS) {
+            rc = sub_rc;
+          }
           if (ctx->rc == GRN_OPERATION_NOT_PERMITTED) {
             ERRCLR(ctx);
           }
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index