[Groonga-commit] groonga/groonga at 12bf0dd [master] select: use "UInt32" for index column value type

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Nov 9 00:07:06 JST 2014


Kouhei Sutou	2014-11-09 00:07:06 +0900 (Sun, 09 Nov 2014)

  New Revision: 12bf0dd73eac666ca67540e2065cc3aa412f2277
  https://github.com/groonga/groonga/commit/12bf0dd73eac666ca67540e2065cc3aa412f2277

  Message:
    select: use "UInt32" for index column value type
    
    It is incompatible change but the current behavior is a bug. Because
    index column value is the number of documents that has the
    term (document frequency) value (UInt32 value) but reported value type
    is table.

  Modified files:
    lib/output.c
    test/command/suite/delete/filter/referenced_records/fulltext_index.expected
    test/command/suite/delete/index/fix_size_column.expected
    test/command/suite/delete/index/key/multiple.expected

  Modified: lib/output.c (+5 -1)
===================================================================
--- lib/output.c    2014-11-08 23:54:40 +0900 (ca44fcb)
+++ lib/output.c    2014-11-09 00:07:06 +0900 (6efc74d)
@@ -1114,7 +1114,11 @@ grn_output_table_column(grn_ctx *ctx, grn_obj *outbuf,
     GRN_BULK_REWIND(buf);
     grn_column_name_(ctx, column, buf);
     grn_output_obj(ctx, outbuf, output_type, buf, NULL);
-    range_id = grn_obj_get_range(ctx, column);
+    if (column->header.type == GRN_COLUMN_INDEX) {
+      range_id = GRN_DB_UINT32;
+    } else {
+      range_id = grn_obj_get_range(ctx, column);
+    }
     if (range_id == GRN_ID_NIL) {
       grn_output_cstr(ctx, outbuf, output_type, "null");
     } else {

  Modified: test/command/suite/delete/filter/referenced_records/fulltext_index.expected (+2 -2)
===================================================================
--- test/command/suite/delete/filter/referenced_records/fulltext_index.expected    2014-11-08 23:54:40 +0900 (905a4ec)
+++ test/command/suite/delete/filter/referenced_records/fulltext_index.expected    2014-11-09 00:07:06 +0900 (70e5346)
@@ -55,7 +55,7 @@ select --table Users
         ],
         [
           "bookmakrs",
-          "Bookmarks"
+          "UInt32"
         ],
         [
           "name",
@@ -88,7 +88,7 @@ select --table Names
         ],
         [
           "users_name",
-          "Users"
+          "UInt32"
         ]
       ],
       [

  Modified: test/command/suite/delete/index/fix_size_column.expected (+2 -2)
===================================================================
--- test/command/suite/delete/index/fix_size_column.expected    2014-11-08 23:54:40 +0900 (653b46a)
+++ test/command/suite/delete/index/fix_size_column.expected    2014-11-09 00:07:06 +0900 (71cce30)
@@ -35,7 +35,7 @@ select Ages
         ],
         [
           "users_age",
-          "Users"
+          "UInt32"
         ]
       ],
       [
@@ -112,7 +112,7 @@ select Ages
         ],
         [
           "users_age",
-          "Users"
+          "UInt32"
         ]
       ],
       [

  Modified: test/command/suite/delete/index/key/multiple.expected (+4 -4)
===================================================================
--- test/command/suite/delete/index/key/multiple.expected    2014-11-08 23:54:40 +0900 (6162a08)
+++ test/command/suite/delete/index/key/multiple.expected    2014-11-09 00:07:06 +0900 (f2bf76f)
@@ -65,7 +65,7 @@ select BigramTokens
         ],
         [
           "memo_key",
-          "Memos"
+          "UInt32"
         ]
       ],
       [
@@ -119,7 +119,7 @@ select TrigramTokens
         ],
         [
           "memo_key",
-          "Memos"
+          "UInt32"
         ]
       ],
       [
@@ -177,7 +177,7 @@ select BigramTokens
         ],
         [
           "memo_key",
-          "Memos"
+          "UInt32"
         ]
       ],
       [
@@ -231,7 +231,7 @@ select TrigramTokens
         ],
         [
           "memo_key",
-          "Memos"
+          "UInt32"
         ]
       ],
       [
-------------- next part --------------
HTML����������������������������...
Download 



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