[Groonga-commit] groonga/groonga at 9516880 [master] schema: use array for sources

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Oct 20 15:16:39 JST 2015


Kouhei Sutou	2015-10-20 15:16:39 +0900 (Tue, 20 Oct 2015)

  New Revision: 9516880823bc5aca5460354aee6d72adc6e2bb09
  https://github.com/groonga/groonga/commit/9516880823bc5aca5460354aee6d72adc6e2bb09

  Message:
    schema: use array for sources
    
    Because order is important in sources.

  Modified files:
    lib/proc.c
    test/command/suite/schema/tables/columns/compress/lz4.expected
    test/command/suite/schema/tables/columns/compress/zlib.expected
    test/command/suite/schema/tables/columns/type/index.expected
    test/command/suite/schema/tables/columns/type/scalar.expected
    test/command/suite/schema/tables/columns/type/vector.expected

  Modified: lib/proc.c (+2 -8)
===================================================================
--- lib/proc.c    2015-10-20 15:11:06 +0900 (026e5b9)
+++ lib/proc.c    2015-10-20 15:16:39 +0900 (2d384b9)
@@ -7908,7 +7908,7 @@ proc_schema_column_output_sources(grn_ctx *ctx, grn_obj *column)
   }
 
   n_ids = GRN_BULK_VSIZE(&source_ids) / sizeof(grn_id);
-  GRN_OUTPUT_MAP_OPEN("sources", n_ids);
+  GRN_OUTPUT_ARRAY_OPEN("sources", n_ids);
   for (i = 0; i < n_ids; i++) {
     grn_id source_id;
     grn_obj *source;
@@ -7916,12 +7916,6 @@ proc_schema_column_output_sources(grn_ctx *ctx, grn_obj *column)
     source_id = GRN_RECORD_VALUE_AT(&source_ids, i);
     source = grn_ctx_at(ctx, source_id);
 
-    if (grn_obj_is_table(ctx, source)) {
-      GRN_OUTPUT_CSTR("_key");
-    } else {
-      proc_schema_output_column_name(ctx, source);
-    }
-
     GRN_OUTPUT_MAP_OPEN("source", 3);
 
     GRN_OUTPUT_CSTR("name");
@@ -7947,7 +7941,7 @@ proc_schema_column_output_sources(grn_ctx *ctx, grn_obj *column)
 
     GRN_OUTPUT_MAP_CLOSE();
   }
-  GRN_OUTPUT_MAP_CLOSE();
+  GRN_OUTPUT_ARRAY_CLOSE();
 
   GRN_OBJ_FIN(ctx, &source_ids);
 }

  Modified: test/command/suite/schema/tables/columns/compress/lz4.expected (+3 -2)
===================================================================
--- test/command/suite/schema/tables/columns/compress/lz4.expected    2015-10-20 15:11:06 +0900 (ac3ede7)
+++ test/command/suite/schema/tables/columns/compress/lz4.expected    2015-10-20 15:16:39 +0900 (4bd39f0)
@@ -203,8 +203,9 @@ schema
             "section": false,
             "weight": false,
             "position": false,
-            "sources": {
-            },
+            "sources": [
+
+            ],
             "command": {
               "name": "column_create",
               "arguments": {

  Modified: test/command/suite/schema/tables/columns/compress/zlib.expected (+3 -2)
===================================================================
--- test/command/suite/schema/tables/columns/compress/zlib.expected    2015-10-20 15:11:06 +0900 (2d9d87c)
+++ test/command/suite/schema/tables/columns/compress/zlib.expected    2015-10-20 15:16:39 +0900 (1a546aa)
@@ -203,8 +203,9 @@ schema
             "section": false,
             "weight": false,
             "position": false,
-            "sources": {
-            },
+            "sources": [
+
+            ],
             "command": {
               "name": "column_create",
               "arguments": {

  Modified: test/command/suite/schema/tables/columns/type/index.expected (+11 -9)
===================================================================
--- test/command/suite/schema/tables/columns/type/index.expected    2015-10-20 15:11:06 +0900 (d74572e)
+++ test/command/suite/schema/tables/columns/type/index.expected    2015-10-20 15:16:39 +0900 (41e2767)
@@ -213,8 +213,9 @@ schema
             "section": false,
             "weight": false,
             "position": false,
-            "sources": {
-            },
+            "sources": [
+
+            ],
             "command": {
               "name": "column_create",
               "arguments": {
@@ -239,8 +240,9 @@ schema
             "section": false,
             "weight": false,
             "position": false,
-            "sources": {
-            },
+            "sources": [
+
+            ],
             "command": {
               "name": "column_create",
               "arguments": {
@@ -296,23 +298,23 @@ schema
             "section": true,
             "weight": true,
             "position": true,
-            "sources": {
-              "_key": {
+            "sources": [
+              {
                 "name": "_key",
                 "table": "Posts",
                 "full_name": "Posts._key"
               },
-              "title": {
+              {
                 "name": "title",
                 "table": "Posts",
                 "full_name": "Posts.title"
               },
-              "content": {
+              {
                 "name": "content",
                 "table": "Posts",
                 "full_name": "Posts.content"
               }
-            },
+            ],
             "command": {
               "name": "column_create",
               "arguments": {

  Modified: test/command/suite/schema/tables/columns/type/scalar.expected (+3 -2)
===================================================================
--- test/command/suite/schema/tables/columns/type/scalar.expected    2015-10-20 15:11:06 +0900 (c26a3a8)
+++ test/command/suite/schema/tables/columns/type/scalar.expected    2015-10-20 15:16:39 +0900 (c07a4e1)
@@ -203,8 +203,9 @@ schema
             "section": false,
             "weight": false,
             "position": false,
-            "sources": {
-            },
+            "sources": [
+
+            ],
             "command": {
               "name": "column_create",
               "arguments": {

  Modified: test/command/suite/schema/tables/columns/type/vector.expected (+3 -2)
===================================================================
--- test/command/suite/schema/tables/columns/type/vector.expected    2015-10-20 15:11:06 +0900 (acd0acc)
+++ test/command/suite/schema/tables/columns/type/vector.expected    2015-10-20 15:16:39 +0900 (99f9123)
@@ -209,8 +209,9 @@ schema
             "section": false,
             "weight": false,
             "position": false,
-            "sources": {
-            },
+            "sources": [
+
+            ],
             "command": {
               "name": "column_create",
               "arguments": {
-------------- next part --------------
HTML����������������������������...
Download 



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