[Groonga-commit] groonga/groonga at 4e5f424 [master] ii: add a missing deleted check

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Aug 30 14:17:51 JST 2016


Kouhei Sutou	2016-08-30 14:17:51 +0900 (Tue, 30 Aug 2016)

  New Revision: 4e5f42412bbbdbdeed622d4fba7f29706bb1cad1
  https://github.com/groonga/groonga/commit/4e5f42412bbbdbdeed622d4fba7f29706bb1cad1

  Message:
    ii: add a missing deleted check
    
    [groonga-dev, 04107]
    
    Reported by Kazuhiko Thanks!!!

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+11 -7)
===================================================================
--- lib/ii.c    2016-08-30 13:36:36 +0900 (97b34ec)
+++ lib/ii.c    2016-08-30 14:17:51 +0900 (9523cf7)
@@ -5110,14 +5110,18 @@ grn_ii_cursor_next_internal(grn_ctx *ctx, grn_ii_cursor *c,
               c->pb.rid = 0;
               if (br->jump > 0 && !BUFFER_REC_DELETED(br)) {
                 buffer_rec *jump_br = BUFFER_REC_AT(c->buf, br->jump);
-                uint8_t *jump_bp;
-                uint32_t jump_rid;
-                jump_bp = GRN_NEXT_ADDR(jump_br);
-                GRN_B_DEC(jump_rid, jump_bp);
-                if (jump_rid < c->min) {
-                  c->nextb = br->jump;
-                } else {
+                if (BUFFER_REC_DELETED(jump_br)) {
                   c->nextb = br->step;
+                } else {
+                  uint8_t *jump_bp;
+                  uint32_t jump_rid;
+                  jump_bp = GRN_NEXT_ADDR(jump_br);
+                  GRN_B_DEC(jump_rid, jump_bp);
+                  if (jump_rid < c->min) {
+                    c->nextb = br->jump;
+                  } else {
+                    c->nextb = br->step;
+                  }
                 }
               } else {
                 c->nextb = br->step;
-------------- next part --------------
HTML����������������������������...
下載 



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