[Groonga-commit] groonga/groonga at c87621f [master] object_inspect: show column flags

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Thu Apr 6 16:18:23 JST 2017


Kouhei Sutou	2017-04-06 16:18:23 +0900 (Thu, 06 Apr 2017)

  New Revision: c87621fba2c62054805677bea9603081b536d2e7
  https://github.com/groonga/groonga/commit/c87621fba2c62054805677bea9603081b536d2e7

  Message:
    object_inspect: show column flags

  Modified files:
    lib/proc/proc_object_inspect.c
    test/command/suite/object_inspect/column/index.expected
    test/command/suite/object_inspect/column/scalar_fix.expected
    test/command/suite/object_inspect/column/scalar_var.expected
    test/command/suite/object_inspect/column/vector.expected

  Modified: lib/proc/proc_object_inspect.c (+18 -8)
===================================================================
--- lib/proc/proc_object_inspect.c    2017-04-06 16:12:17 +0900 (7c51997)
+++ lib/proc/proc_object_inspect.c    2017-04-06 16:18:23 +0900 (5590b0c)
@@ -241,22 +241,32 @@ command_object_inspect_column_value(grn_ctx *ctx, grn_obj *column)
 }
 
 static void
-command_object_inspect_column(grn_ctx *ctx, grn_obj *obj)
+command_object_inspect_column(grn_ctx *ctx, grn_obj *column)
 {
-  grn_ctx_output_map_open(ctx, "column", 5);
+  grn_ctx_output_map_open(ctx, "column", 9);
   {
+    grn_column_flags column_flags;
+
+    column_flags = grn_column_get_flags(ctx, column);
+
     grn_ctx_output_cstr(ctx, "id");
-    grn_ctx_output_uint64(ctx, grn_obj_id(ctx, obj));
+    grn_ctx_output_uint64(ctx, grn_obj_id(ctx, column));
     grn_ctx_output_cstr(ctx, "name");
-    command_object_inspect_column_name(ctx, obj);
+    command_object_inspect_column_name(ctx, column);
     grn_ctx_output_cstr(ctx, "table");
-    command_object_inspect_table(ctx, grn_ctx_at(ctx, obj->header.domain));
+    command_object_inspect_table(ctx, grn_ctx_at(ctx, column->header.domain));
     grn_ctx_output_cstr(ctx, "full_name");
-    command_object_inspect_obj_name(ctx, obj);
+    command_object_inspect_obj_name(ctx, column);
     grn_ctx_output_cstr(ctx, "type");
-    command_object_inspect_column_type(ctx, obj);
+    command_object_inspect_column_type(ctx, column);
     grn_ctx_output_cstr(ctx, "value");
-    command_object_inspect_column_value(ctx, obj);
+    command_object_inspect_column_value(ctx, column);
+    grn_ctx_output_cstr(ctx, "section");
+    grn_ctx_output_bool(ctx, (column_flags & GRN_OBJ_WITH_SECTION) != 0);
+    grn_ctx_output_cstr(ctx, "weight");
+    grn_ctx_output_bool(ctx, (column_flags & GRN_OBJ_WITH_WEIGHT) != 0);
+    grn_ctx_output_cstr(ctx, "position");
+    grn_ctx_output_bool(ctx, (column_flags & GRN_OBJ_WITH_POSITION) != 0);
   }
   grn_ctx_output_map_close(ctx);
 }

  Modified: test/command/suite/object_inspect/column/index.expected (+4 -1)
===================================================================
--- test/command/suite/object_inspect/column/index.expected    2017-04-06 16:12:17 +0900 (fc790f5)
+++ test/command/suite/object_inspect/column/index.expected    2017-04-06 16:18:23 +0900 (70a51f5)
@@ -61,6 +61,9 @@ object_inspect Terms.memos_title_content
         },
         "size": 4
       }
-    }
+    },
+    "section": true,
+    "weight": false,
+    "position": true
   }
 ]

  Modified: test/command/suite/object_inspect/column/scalar_fix.expected (+4 -1)
===================================================================
--- test/command/suite/object_inspect/column/scalar_fix.expected    2017-04-06 16:12:17 +0900 (c619d0e)
+++ test/command/suite/object_inspect/column/scalar_fix.expected    2017-04-06 16:18:23 +0900 (0fc00e2)
@@ -55,6 +55,9 @@ object_inspect Users.age
         },
         "size": 1
       }
-    }
+    },
+    "section": false,
+    "weight": false,
+    "position": false
   }
 ]

  Modified: test/command/suite/object_inspect/column/scalar_var.expected (+4 -1)
===================================================================
--- test/command/suite/object_inspect/column/scalar_var.expected    2017-04-06 16:12:17 +0900 (efaf861)
+++ test/command/suite/object_inspect/column/scalar_var.expected    2017-04-06 16:18:23 +0900 (3bcdb3c)
@@ -43,6 +43,9 @@ object_inspect Memos.title
         },
         "size": 4096
       }
-    }
+    },
+    "section": false,
+    "weight": false,
+    "position": false
   }
 ]

  Modified: test/command/suite/object_inspect/column/vector.expected (+4 -1)
===================================================================
--- test/command/suite/object_inspect/column/vector.expected    2017-04-06 16:12:17 +0900 (2486074)
+++ test/command/suite/object_inspect/column/vector.expected    2017-04-06 16:18:23 +0900 (965eaa3)
@@ -43,6 +43,9 @@ object_inspect Memos.tags
         },
         "size": 4096
       }
-    }
+    },
+    "section": false,
+    "weight": false,
+    "position": false
   }
 ]
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る