[Groonga-commit] groonga/groonga at 47091cd [master] Fix a bug that the number of indexes isn't correct if index buffer is NULL

Back to archive index

Kouhei Sutou null+****@clear*****
Mon May 13 18:42:35 JST 2013


Kouhei Sutou	2013-05-13 18:42:35 +0900 (Mon, 13 May 2013)

  New Revision: 47091cd18b06d7ab20f48c0fbf6fb052ac21182a
  https://github.com/groonga/groonga/commit/47091cd18b06d7ab20f48c0fbf6fb052ac21182a

  Message:
    Fix a bug that the number of indexes isn't correct if index buffer is NULL

  Modified files:
    lib/db.c

  Modified: lib/db.c (+6 -3)
===================================================================
--- lib/db.c    2013-05-13 17:34:47 +0900 (116b945)
+++ lib/db.c    2013-05-13 18:42:35 +0900 (1231a69)
@@ -8484,14 +8484,16 @@ grn_column_index(grn_ctx *ctx, grn_obj *obj, grn_operator op,
     switch (op) {
     case GRN_OP_EQUAL :
     case GRN_OP_TERM_EXTRACT :
-      if (buf_size) { indexbuf[n++] = obj; }
+      if (buf_size) { indexbuf[n] = obj; }
+      n++;
       break;
     case GRN_OP_PREFIX :
       {
         grn_accessor *a = (grn_accessor *)obj;
         if (a->action == GRN_ACCESSOR_GET_KEY) {
           if (a->obj->header.type == GRN_TABLE_PAT_KEY) {
-            if (buf_size) { indexbuf[n++] = obj; }
+            if (buf_size) { indexbuf[n] = obj; }
+            n++;
           }
           /* FIXME: GRN_TABLE_DAT_KEY should be supported */
         }
@@ -8503,7 +8505,8 @@ grn_column_index(grn_ctx *ctx, grn_obj *obj, grn_operator op,
         if (a->action == GRN_ACCESSOR_GET_KEY) {
           if (a->obj->header.type == GRN_TABLE_PAT_KEY &&
               a->obj->header.flags & GRN_OBJ_KEY_WITH_SIS) {
-            if (buf_size) { indexbuf[n++] = obj; }
+            if (buf_size) { indexbuf[n] = obj; }
+            n++;
           }
         }
       }
-------------- next part --------------
HTML����������������������������...
Download 



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