[Groonga-commit] groonga/groonga at d85d54f [master] Fix a memory leak on getting nested reference vector column value

アーカイブの一覧に戻る
Kouhei Sutou null+****@clear*****
Wed Nov 21 11:56:16 JST 2018


Kouhei Sutou	2018-11-21 11:56:16 +0900 (Wed, 21 Nov 2018)

  Revision: d85d54fd2505149c562b3d6c0bd02ea81aa6326a
  https://github.com/groonga/groonga/commit/d85d54fd2505149c562b3d6c0bd02ea81aa6326a

  Message:
    Fix a memory leak on getting nested reference vector column value

  Added files:
    test/command/suite/select/filter/vector/reference/many/nest.expected
    test/command/suite/select/filter/vector/reference/many/nest.test
  Modified files:
    lib/db.c

  Modified: lib/db.c (+1 -0)
===================================================================
--- lib/db.c    2018-11-20 16:25:46 +0900 (4cd7406a2)
+++ lib/db.c    2018-11-21 11:56:16 +0900 (020c7ddc6)
@@ -7075,6 +7075,7 @@ grn_accessor_get_value(grn_ctx *ctx, grn_accessor *a, grn_id id, grn_obj *value)
           }
         }
         GRN_OBJ_FIN(ctx, &sub_value);
+        GRN_OBJ_FIN(ctx, &sub_records);
         return value;
       } else {
         vp = GRN_BULK_HEAD(value) + size0;

  Added: test/command/suite/select/filter/vector/reference/many/nest.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/vector/reference/many/nest.expected    2018-11-21 11:56:16 +0900 (cfbb91a04)
@@ -0,0 +1,64 @@
+table_create Tags TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Entries TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Entries tags COLUMN_VECTOR Tags
+[[0,0.0,0.0],true]
+load --table Entries
+[
+{
+  "tags": [
+    "tag0",
+    "tag1",
+    "tag2",
+    "tag3",
+    "tag4",
+    "tag5",
+    "tag6",
+    "tag7",
+    "tag8",
+    "tag9"
+  ]
+}
+]
+[[0,0.0,0.0],1]
+select Entries --filter 'tags._key'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "tags",
+          "Tags"
+        ]
+      ],
+      [
+        1,
+        [
+          "tag0",
+          "tag1",
+          "tag2",
+          "tag3",
+          "tag4",
+          "tag5",
+          "tag6",
+          "tag7",
+          "tag8",
+          "tag9"
+        ]
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/vector/reference/many/nest.test (+24 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/vector/reference/many/nest.test    2018-11-21 11:56:16 +0900 (115b1501a)
@@ -0,0 +1,24 @@
+table_create Tags TABLE_HASH_KEY ShortText
+
+table_create Entries TABLE_NO_KEY
+column_create Entries tags COLUMN_VECTOR Tags
+
+load --table Entries
+[
+{
+  "tags": [
+    "tag0",
+    "tag1",
+    "tag2",
+    "tag3",
+    "tag4",
+    "tag5",
+    "tag6",
+    "tag7",
+    "tag8",
+    "tag9"
+  ]
+}
+]
+
+select Entries --filter 'tags._key'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181121/3b89bde5/attachment-0001.html>


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