[Groonga-commit] groonga/groonga at 4c16e03 [master] Fix a memory leak for "VECTOR_COLUMN == xxx" expression

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Mon May 20 18:40:23 JST 2013


Kouhei Sutou	2013-05-20 18:40:23 +0900 (Mon, 20 May 2013)

  New Revision: 4c16e0365e4a70f53d03b9be5313fdd8ea0e9d5e
  https://github.com/groonga/groonga/commit/4c16e0365e4a70f53d03b9be5313fdd8ea0e9d5e

  Message:
    Fix a memory leak for "VECTOR_COLUMN == xxx" expression
    
    The added test can check the memory leak but the feature isn't
    implemented yet. :p

  Added files:
    test/command/suite/select/filter/vector/equal.expected
    test/command/suite/select/filter/vector/equal.test
  Modified files:
    lib/expr.c

  Modified: lib/expr.c (+1 -2)
===================================================================
--- lib/expr.c    2013-05-20 17:06:07 +0900 (72dd84b)
+++ lib/expr.c    2013-05-20 18:40:23 +0900 (4016e7b)
@@ -3186,9 +3186,8 @@ grn_expr_exec(grn_ctx *ctx, grn_obj *expr, int nargs)
           grn_obj *x, *y;
           POP2ALLOC1(x, y, res);
           DO_EQ(x, y, r);
+          grn_obj_reinit(ctx, res, GRN_DB_INT32, 0);
           GRN_INT32_SET(ctx, res, r);
-          res->header.type = GRN_BULK;
-          res->header.domain = GRN_DB_INT32;
         }
         code++;
         break;

  Added: test/command/suite/select/filter/vector/equal.expected (+38 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/vector/equal.expected    2013-05-20 18:40:23 +0900 (aabf290)
@@ -0,0 +1,38 @@
+table_create Memos TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Memos tags COLUMN_VECTOR ShortText
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"_key": "groonga is very fast", "tags": ["groonga"]}
+]
+[[0,0.0,0.0],1]
+select Memos --filter 'tags == ["groonga"]'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        0
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "tags",
+          "ShortText"
+        ]
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/vector/equal.test (+10 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/vector/equal.test    2013-05-20 18:40:23 +0900 (db02aa2)
@@ -0,0 +1,10 @@
+table_create Memos TABLE_HASH_KEY ShortText
+column_create Memos tags COLUMN_VECTOR ShortText
+
+load --table Memos
+[
+{"_key": "groonga is very fast", "tags": ["groonga"]}
+]
+
+# TODO: support it!
+select Memos --filter 'tags == ["groonga"]'
-------------- next part --------------
HTML����������������������������...
ダウンロード 



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