[Groonga-mysql-commit] mroonga/mroonga [master] [wrapper][write] fix wrong ID resolution.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 6月 18日 (土) 21:02:54 JST


Kouhei Sutou	2011-06-18 12:02:54 +0000 (Sat, 18 Jun 2011)

  New Revision: 2f456c9ef7105a32110c1ad624799a8b8c849f22

  Log:
    [wrapper][write] fix wrong ID resolution.

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+9 -3)
===================================================================
--- ha_mroonga.cc    2011-06-18 11:54:25 +0000 (fc961f4)
+++ ha_mroonga.cc    2011-06-18 12:02:54 +0000 (dd4f5dd)
@@ -847,9 +847,15 @@ static float mrn_wrapper_ft_find_relevance(FT_INFO *handler, uchar *record,
                             GRN_TEXT_LEN(&(info->key)));
 
   if (record_id != GRN_ID_NIL) {
-    GRN_BULK_REWIND(&(info->score));
-    grn_obj_get_value(info->ctx, info->score_column, record_id, &(info->score));
-    score = (float)GRN_INT32_VALUE(&(info->score));
+    grn_id result_record_id;
+    result_record_id = grn_table_get(info->ctx, info->result,
+                                     &record_id, sizeof(grn_id));
+    if (result_record_id != GRN_ID_NIL) {
+      GRN_BULK_REWIND(&(info->score));
+      grn_obj_get_value(info->ctx, info->score_column,
+                        result_record_id, &(info->score));
+      score = (float)GRN_INT32_VALUE(&(info->score));
+    }
   }
 
   DBUG_RETURN(score);




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