[Groonga-commit] ranguba/rroonga at af8022c [master] Add SCALAR/VECTOR information to data column inspect

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Aug 12 17:37:55 JST 2016


Kouhei Sutou	2016-08-12 17:37:55 +0900 (Fri, 12 Aug 2016)

  New Revision: af8022cfca3c5c92848b221458783ac870aeb2c8
  https://github.com/ranguba/rroonga/commit/af8022cfca3c5c92848b221458783ac870aeb2c8

  Message:
    Add SCALAR/VECTOR information to data column inspect

  Modified files:
    ext/groonga/rb-grn-object.c
    test/test-schema.rb

  Modified: ext/groonga/rb-grn-object.c (+14 -9)
===================================================================
--- ext/groonga/rb-grn-object.c    2016-08-12 17:35:14 +0900 (99dd121)
+++ ext/groonga/rb-grn-object.c    2016-08-12 17:37:55 +0900 (e99840e)
@@ -888,22 +888,27 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
         break;
     }
 
-    if (0) {
-        if (flags & GRN_OBJ_COLUMN_SCALAR)
+    switch (object->header.type) {
+    case GRN_COLUMN_FIX_SIZE:
+    case GRN_COLUMN_VAR_SIZE:
+        if (flags & GRN_OBJ_COLUMN_SCALAR) {
             rb_ary_push(inspected_flags, rb_str_new_cstr("COLUMN_SCALAR"));
-        if (flags & GRN_OBJ_COLUMN_VECTOR)
+        } else if (flags & GRN_OBJ_COLUMN_VECTOR) {
             rb_ary_push(inspected_flags, rb_str_new_cstr("COLUMN_VECTOR"));
-        if (flags & GRN_OBJ_COLUMN_INDEX)
-            rb_ary_push(inspected_flags, rb_str_new_cstr("COLUMN_INDEX"));
+        }
+        break;
+    default:
+        break;
     }
 
     switch (object->header.type) {
       case GRN_COLUMN_FIX_SIZE:
       case GRN_COLUMN_VAR_SIZE:
-        if (flags & GRN_OBJ_COMPRESS_ZLIB)
-            rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_ZLIB"));
-        if (flags & GRN_OBJ_COMPRESS_LZ4)
-            rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_LZ4"));
+          if (flags & GRN_OBJ_COMPRESS_ZLIB) {
+              rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_ZLIB"));
+          } else if (flags & GRN_OBJ_COMPRESS_LZ4) {
+              rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_LZ4"));
+          }
         break;
       case GRN_COLUMN_INDEX:
         if (flags & GRN_OBJ_WITH_SECTION)

  Modified: test/test-schema.rb (+1 -1)
===================================================================
--- test/test-schema.rb    2016-08-12 17:35:14 +0900 (294c675)
+++ test/test-schema.rb    2016-08-12 17:37:55 +0900 (ad5b2c4)
@@ -371,7 +371,7 @@ class SchemaTest < Test::Unit::TestCase
                    "path: <#{path}>, " +
                    "domain: <Posts>, " +
                    "range: <Niku>, " +
-                   "flags: <KEY_VAR_SIZE|COMPRESS_LZ4>>",
+                   "flags: <COLUMN_VECTOR|COMPRESS_LZ4>>",
                    column.inspect)
     end
   end
-------------- next part --------------
HTML����������������������������...
다운로드 



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