[Groonga-commit] groonga/groonga [master] Fix a bug that grn_index_cursor_next() returns NULL unexpectedly

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Feb 9 11:57:50 JST 2013


Kouhei Sutou	2013-02-09 11:57:50 +0900 (Sat, 09 Feb 2013)

  New Revision: 60a00564d2e9b99c898a25e4ecb3f5c43fb8cf97
  https://github.com/groonga/groonga/commit/60a00564d2e9b99c898a25e4ecb3f5c43fb8cf97

  Log:
    Fix a bug that grn_index_cursor_next() returns NULL unexpectedly
    
    It causes mroonga's bug.
    
    Index may have garbages after deleting entries. For the index entry,
    grn_ii_cursor_next() returns NULL. It should be ignored in
    grn_index_cursor_next(). But it returns NULL for the case without this
    change.
    
    [groonga-dev,01192]
    
    Reported by b senboku. Thanks!!!

  Modified files:
    lib/db.c

  Modified: lib/db.c (+3 -1)
===================================================================
--- lib/db.c    2013-02-07 19:23:13 +0900 (8cf7e26)
+++ lib/db.c    2013-02-09 11:57:50 +0900 (79e17fb)
@@ -2282,7 +2282,9 @@ grn_index_cursor_next(grn_ctx *ctx, grn_obj *c, grn_id *tid)
         if (ip && ic->flags & GRN_OBJ_WITH_POSITION) {
           ip = grn_ii_cursor_next_pos(ctx, ic->iic);
         }
-        break;
+        if (ip) {
+          break;
+        }
       }
     }
   }
-------------- next part --------------
HTML����������������������������...
Download 



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