[Groonga-commit] groonga/groonga [master] Fixed a bug in grn_text_otoj(). grn_ctx_at() is inappropriate to validate record id.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 10月 1日 (金) 14:44:24 JST


Daijiro MORI	2010-10-01 05:44:24 +0000 (Fri, 01 Oct 2010)

  New Revision: cd8d5c4352e17b14af9990dd90c955aa1e5ca59f

  Log:
    Fixed a bug in grn_text_otoj(). grn_ctx_at() is inappropriate to validate record id.

  Modified files:
    lib/str.c

  Modified: lib/str.c (+2 -3)
===================================================================
--- lib/str.c    2010-10-01 04:56:45 +0000 (2791841)
+++ lib/str.c    2010-10-01 05:44:24 +0000 (6701a80)
@@ -2661,14 +2661,13 @@ grn_text_otoj(grn_ctx *ctx, grn_obj *bulk, grn_obj *obj, grn_obj_format *format)
         grn_obj *table = grn_ctx_at(ctx, obj->header.domain);
         grn_id id = *((grn_id *)GRN_BULK_HEAD(obj));
         if (table && table->header.type != GRN_TABLE_NO_KEY) {
-          grn_obj *record = grn_ctx_at(ctx, id);
-          if (record) {
+          /* todo : temporal patch. grn_table_at() is kinda costful... */
+          if (grn_table_at(ctx, table, id)) {
             grn_obj *accessor = grn_obj_column(ctx, table, "_key", 4);
             if (accessor) {
               grn_obj_get_value(ctx, accessor, id, &buf);
               grn_obj_unlink(ctx, accessor);
             }
-            grn_obj_unlink(ctx, record);
           }
           grn_text_otoj(ctx, bulk, &buf, format);
         } else {




Groonga-commit メーリングリストの案内
Back to archive index