[Groonga-commit] groonga/groonga at 186a5d9 [master] Stop to remove invalid hook without "force"

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Aug 31 17:34:51 JST 2016


Kouhei Sutou	2016-08-31 17:34:51 +0900 (Wed, 31 Aug 2016)

  New Revision: 186a5d943d1fb5066a0a2877939b26c21a81b174
  https://github.com/groonga/groonga/commit/186a5d943d1fb5066a0a2877939b26c21a81b174

  Message:
    Stop to remove invalid hook without "force"

  Modified files:
    lib/db.c
    test/command/suite/sharding/logical_table_remove/broken/index_column/dependent_force.expected
    test/command/suite/sharding/logical_table_remove/broken/index_column/force.expected
    test/command/suite/sharding/logical_table_remove/broken/lexicon/dependent_force.expected
    test/command/suite/sharding/logical_table_remove/broken/lexicon/force.expected
    test/command/suite/sharding/logical_table_remove/broken/table_and_column/dependent_force.expected
    test/command/suite/sharding/logical_table_remove/broken/table_and_column/force.expected

  Modified: lib/db.c (+6 -6)
===================================================================
--- lib/db.c    2016-08-31 16:51:57 +0900 (fda582f)
+++ lib/db.c    2016-08-31 17:34:51 +0900 (578ba85)
@@ -8854,7 +8854,6 @@ remove_index(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry)
   grn_hook *h0, *hooks = DB_OBJ(obj)->hooks[entry];
   DB_OBJ(obj)->hooks[entry] = NULL; /* avoid mutual recursive call */
   while (hooks) {
-    grn_rc sub_rc;
     grn_obj_default_set_value_hook_data *data = (void *)GRN_NEXT_ADDR(hooks);
     grn_obj *target = grn_ctx_at(ctx, data->target);
     if (!target) {
@@ -8874,10 +8873,10 @@ remove_index(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry)
           "hook has a dangling reference: <%.*s> -> <%.*s>",
           length, name,
           hook_name_length, hook_name);
-      sub_rc = ctx->rc;
+      rc = ctx->rc;
     } else if (target->header.type == GRN_COLUMN_INDEX) {
       //TODO: multicolumn  MULTI_COLUMN_INDEXP
-      sub_rc = _grn_obj_remove(ctx, target, GRN_FALSE);
+      rc = _grn_obj_remove(ctx, target, GRN_FALSE);
     } else {
       //TODO: err
       char fn[GRN_TABLE_MAX_KEY_SIZE];
@@ -8885,10 +8884,11 @@ remove_index(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry)
       flen = grn_obj_name(ctx, target, fn, GRN_TABLE_MAX_KEY_SIZE);
       fn[flen] = '\0';
       ERR(GRN_UNKNOWN_ERROR, "column has unsupported hooks, col=%s",fn);
-      sub_rc = ctx->rc;
+      rc = ctx->rc;
     }
-    if (rc == GRN_SUCCESS) {
-      rc = sub_rc;
+    if (rc != GRN_SUCCESS) {
+      DB_OBJ(obj)->hooks[entry] = hooks;
+      break;
     }
     h0 = hooks;
     hooks = hooks->next;

  Modified: test/command/suite/sharding/logical_table_remove/broken/index_column/dependent_force.expected (+3 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/broken/index_column/dependent_force.expected    2016-08-31 16:51:57 +0900 (9bf259d)
+++ test/command/suite/sharding/logical_table_remove/broken/index_column/dependent_force.expected    2016-08-31 17:34:51 +0900 (b795d43)
@@ -56,6 +56,9 @@ logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border
 #|e| [column][remove][index] hook has a dangling reference: <Logs_20150204.timestamp> -> <Times_20150204.timestamp_index>
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000114>
 #|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
+#|e| [column][remove][index] hook has a dangling reference: <Logs_20150204.timestamp> -> <Times_20150204.timestamp_index>
+#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000114>
+#|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
 #|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
 #|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
 #|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)

  Modified: test/command/suite/sharding/logical_table_remove/broken/index_column/force.expected (+3 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/broken/index_column/force.expected    2016-08-31 16:51:57 +0900 (b63c966)
+++ test/command/suite/sharding/logical_table_remove/broken/index_column/force.expected    2016-08-31 17:34:51 +0900 (dc53835)
@@ -55,6 +55,9 @@ logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border
 #|e| [column][remove][index] hook has a dangling reference: <Logs_20150204.timestamp> -> <Times_20150204.timestamp_index>
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000114>
 #|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
+#|e| [column][remove][index] hook has a dangling reference: <Logs_20150204.timestamp> -> <Times_20150204.timestamp_index>
+#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000114>
+#|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
 object_exist Times_20150204.timestamp_index
 [[0,0.0,0.0],true]
 dump

  Modified: test/command/suite/sharding/logical_table_remove/broken/lexicon/dependent_force.expected (+4 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/broken/lexicon/dependent_force.expected    2016-08-31 16:51:57 +0900 (0590e66)
+++ test/command/suite/sharding/logical_table_remove/broken/lexicon/dependent_force.expected    2016-08-31 17:34:51 +0900 (423482a)
@@ -60,6 +60,10 @@ logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border
 #|e| [column][remove][index] hook has a dangling reference: <Logs_20150204.timestamp> -> <Times_20150204.timestamp_index>
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000113>
 #|e| grn_ctx_at: failed to open object: <275>(<Times_20150204>):<49>(<table:pat_key>)
+#|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
+#|e| [column][remove][index] hook has a dangling reference: <Logs_20150204.timestamp> -> <Times_20150204.timestamp_index>
+#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000113>
+#|e| grn_ctx_at: failed to open object: <275>(<Times_20150204>):<49>(<table:pat_key>)
 #|e| grn_ctx_at: failed to open object: <275>(<Times_20150204>):<49>(<table:pat_key>)
 #|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
 #|e| grn_ctx_at: failed to open object: <275>(<Times_20150204>):<49>(<table:pat_key>)

  Modified: test/command/suite/sharding/logical_table_remove/broken/lexicon/force.expected (+4 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/broken/lexicon/force.expected    2016-08-31 16:51:57 +0900 (c424226)
+++ test/command/suite/sharding/logical_table_remove/broken/lexicon/force.expected    2016-08-31 17:34:51 +0900 (3a97524)
@@ -58,6 +58,10 @@ logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border
 #|e| [column][remove][index] hook has a dangling reference: <Logs_20150204.timestamp> -> <Times_20150204.timestamp_index>
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000113>
 #|e| grn_ctx_at: failed to open object: <275>(<Times_20150204>):<49>(<table:pat_key>)
+#|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
+#|e| [column][remove][index] hook has a dangling reference: <Logs_20150204.timestamp> -> <Times_20150204.timestamp_index>
+#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000113>
+#|e| grn_ctx_at: failed to open object: <275>(<Times_20150204>):<49>(<table:pat_key>)
 #|e| grn_ctx_at: failed to open object: <275>(<Times_20150204>):<49>(<table:pat_key>)
 #|e| grn_ctx_at: failed to open object: <276>(<Times_20150204.timestamp_index>):<72>(<column:index>)
 dump

  Modified: test/command/suite/sharding/logical_table_remove/broken/table_and_column/dependent_force.expected (+2 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/broken/table_and_column/dependent_force.expected    2016-08-31 16:51:57 +0900 (d1a6998)
+++ test/command/suite/sharding/logical_table_remove/broken/table_and_column/dependent_force.expected    2016-08-31 17:34:51 +0900 (d73ab98)
@@ -54,6 +54,8 @@ logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000112>
 #|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
 #|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
+#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110>
+#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>)
 dump
 plugin_register sharding
 

  Modified: test/command/suite/sharding/logical_table_remove/broken/table_and_column/force.expected (+2 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/broken/table_and_column/force.expected    2016-08-31 16:51:57 +0900 (fbdb575)
+++ test/command/suite/sharding/logical_table_remove/broken/table_and_column/force.expected    2016-08-31 17:34:51 +0900 (c01302d)
@@ -53,6 +53,8 @@ logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border
 #|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>)
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000112>
 #|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
+#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110>
+#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>)
 dump
 plugin_register sharding
 
-------------- next part --------------
HTML����������������������������...
Download 



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