[Groonga-commit] groonga/groonga at 1b3bb5b [master] Fix a memory leak

Back to archive index

Kouhei Sutou null+****@clear*****
Sat May 23 15:25:26 JST 2015


Kouhei Sutou	2015-05-23 15:25:26 +0900 (Sat, 23 May 2015)

  New Revision: 1b3bb5b37e9ba1e1454610e6500a351d0ee76c03
  https://github.com/groonga/groonga/commit/1b3bb5b37e9ba1e1454610e6500a351d0ee76c03

  Message:
    Fix a memory leak
    
    It's occurred when --match_columns and --query are used for non indexed
    text field and text fields have a value that isn't bulk
    embeddable. Normally, 32byte over size text isn't bulk embeddable.

  Added files:
    test/command/suite/select/match_columns/no_index/long_text.expected
    test/command/suite/select/match_columns/no_index/long_text.test
  Modified files:
    lib/db.c

  Modified: lib/db.c (+1 -1)
===================================================================
--- lib/db.c    2015-05-23 11:32:58 +0900 (be031f3)
+++ lib/db.c    2015-05-23 15:25:26 +0900 (36525f7)
@@ -7005,7 +7005,7 @@ grn_obj_get_value(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value)
   }
   switch (value->header.type) {
   case GRN_VOID :
-    GRN_TEXT_INIT(value, 0);
+    grn_obj_reinit(ctx, value, GRN_DB_TEXT, 0);
     break;
   case GRN_BULK :
   case GRN_VECTOR :

  Added: test/command/suite/select/match_columns/no_index/long_text.expected (+39 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/no_index/long_text.expected    2015-05-23 15:25:26 +0900 (b16c448)
@@ -0,0 +1,39 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"content": "Groonga - test that requires outplace bulk (>= GRN_BULK_BUFSIZE)"},
+{"content": "short text"}
+]
+[[0,0.0,0.0],2]
+select Memos --match_columns content --query Groonga
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "ShortText"
+        ]
+      ],
+      [
+        1,
+        "Groonga - test that requires outplace bulk (>= GRN_BULK_BUFSIZE)"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/match_columns/no_index/long_text.test (+10 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/no_index/long_text.test    2015-05-23 15:25:26 +0900 (e8b13d8)
@@ -0,0 +1,10 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR ShortText
+
+load --table Memos
+[
+{"content": "Groonga - test that requires outplace bulk (>= GRN_BULK_BUFSIZE)"},
+{"content": "short text"}
+]
+
+select Memos --match_columns content --query Groonga
-------------- next part --------------
HTML����������������������������...
Download 



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