[Groonga-commit] groonga/groonga [master] Take GRN_VECTOR into account in GRN_BULK_REWIND

Back to archive index

Daijiro MORI null+****@clear*****
Mon Apr 15 21:00:41 JST 2013


Daijiro MORI	2013-04-15 21:00:41 +0900 (Mon, 15 Apr 2013)

  New Revision: c7c82a8f9909656978c0b9bf3be3ec55def9d8f0
  https://github.com/groonga/groonga/commit/c7c82a8f9909656978c0b9bf3be3ec55def9d8f0

  Message:
    Take GRN_VECTOR into account in GRN_BULK_REWIND

  Modified files:
    include/groonga.h

  Modified: include/groonga.h (+15 -3)
===================================================================
--- include/groonga.h    2013-04-14 11:21:19 +0900 (b0ae406)
+++ include/groonga.h    2013-04-15 21:00:41 +0900 (5396d83)
@@ -2152,10 +2152,22 @@ GRN_API const char *grn_default_query_logger_get_path(void);
 #define GRN_BULK_BUFSIZE (sizeof(grn_obj) - sizeof(grn_obj_header))
 #define GRN_BULK_OUTP(bulk) ((bulk)->header.impl_flags & GRN_OBJ_OUTPLACE)
 #define GRN_BULK_REWIND(bulk) do {\
-  if (GRN_BULK_OUTP(bulk)) {\
-    (bulk)->u.b.curr = (bulk)->u.b.head;\
+  if ((bulk)->header.type == GRN_VECTOR) {\
+    grn_obj *body = (bulk)->u.v.body;\
+    if (body) {\
+      if (GRN_BULK_OUTP(body)) {\
+        (body)->u.b.curr = (body)->u.b.head;\
+      } else {\
+        (body)->header.flags = 0;\
+      }\
+    }\
+    (bulk)->u.v.n_sections = 0;\
   } else {\
-    (bulk)->header.flags = 0;\
+    if (GRN_BULK_OUTP(bulk)) {\
+      (bulk)->u.b.curr = (bulk)->u.b.head;\
+    } else {\
+      (bulk)->header.flags = 0;\
+    }\
   }\
 } while (0)
 #define GRN_BULK_WSIZE(bulk) \
-------------- next part --------------
HTML����������������������������...
Download 



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