[Groonga-commit] groonga/groonga at 61885eb [master] mrb: Column#[] returns native mruby object not Bulk

Back to archive index

Kouhei Sutou null+****@clear*****
Tue May 22 15:33:14 JST 2018


Kouhei Sutou	2018-05-22 15:33:14 +0900 (Tue, 22 May 2018)

  New Revision: 61885eb6edf9144e36300c430f283c514ba13bc5
  https://github.com/groonga/groonga/commit/61885eb6edf9144e36300c430f283c514ba13bc5

  Message:
    mrb: Column#[] returns native mruby object not Bulk

  Modified files:
    lib/mrb/mrb_column.c
    lib/mrb/scripts/expression_rewriters.rb

  Modified: lib/mrb/mrb_column.c (+8 -4)
===================================================================
--- lib/mrb/mrb_column.c    2018-05-22 15:32:47 +0900 (3b2acab7a)
+++ lib/mrb/mrb_column.c    2018-05-22 15:33:14 +0900 (9ff411d56)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2013-2017 Brazil
+  Copyright(C) 2013-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -53,13 +53,17 @@ mrb_grn_column_array_reference(mrb_state *mrb, mrb_value self)
   grn_ctx *ctx = (grn_ctx *)mrb->ud;
   grn_obj *column;
   mrb_int record_id;
-  grn_obj *column_value;
+  grn_obj column_value;
+  mrb_value rb_column_value;
 
   column = DATA_PTR(self);
   mrb_get_args(mrb, "i", &record_id);
 
-  column_value = grn_obj_get_value(ctx, column, record_id, NULL);
-  return grn_mrb_value_from_grn_obj(mrb, column_value);
+  GRN_VOID_INIT(&column_value);
+  grn_obj_get_value(ctx, column, record_id, &column_value);
+  rb_column_value = grn_mrb_value_from_bulk(mrb, &column_value);
+  GRN_OBJ_FIN(ctx, &column_value);
+  return rb_column_value;
 }
 
 static mrb_value

  Modified: lib/mrb/scripts/expression_rewriters.rb (+1 -1)
===================================================================
--- lib/mrb/scripts/expression_rewriters.rb    2018-05-22 15:32:47 +0900 (ae773541e)
+++ lib/mrb/scripts/expression_rewriters.rb    2018-05-22 15:33:14 +0900 (97c290294)
@@ -28,7 +28,7 @@ module Groonga
           name = record.key
           rewriter = @rewriters[name]
           if rewriter.nil?
-            plugin_name = record.plugin_name.value
+            plugin_name = record.plugin_name
             require plugin_name
             rewriter = @rewriters[name]
             raise "unknown rewriter: <#{name}>:<#{plugin_name}>" if rewriter.nil?
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180522/555db723/attachment-0001.htm 



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