[Groonga-commit] groonga/groonga at ba2a23e [master] Use predicate macro for normal index column

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Feb 21 15:23:46 JST 2014


Kouhei Sutou	2014-02-21 15:23:46 +0900 (Fri, 21 Feb 2014)

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

  Message:
    Use predicate macro for normal index column

  Modified files:
    lib/db.c
    lib/db.h

  Modified: lib/db.c (+1 -1)
===================================================================
--- lib/db.c    2014-02-21 15:15:01 +0900 (710ae1a)
+++ lib/db.c    2014-02-21 15:23:46 +0900 (ac0d48d)
@@ -2760,7 +2760,7 @@ grn_obj_search_accessor(grn_ctx *ctx, grn_obj *obj, grn_obj *query,
   n_accessors = 0;
   for (a = (grn_accessor *)obj; a; a = a->next) {
     n_accessors++;
-    if (a->obj->header.type == GRN_COLUMN_INDEX) {
+    if (GRN_OBJ_NORMAL_INDEX_COLUMNP(a->obj)) {
       break;
     }
   }

  Modified: lib/db.h (+5 -0)
===================================================================
--- lib/db.h    2014-02-21 15:15:01 +0900 (bf8f572)
+++ lib/db.h    2014-02-21 15:23:46 +0900 (e3e6954)
@@ -143,6 +143,11 @@ struct _grn_type {
    (GRN_TABLE_HASH_KEY <= ((grn_db_obj *)obj)->header.type) &&\
    (((grn_db_obj *)obj)->header.type <= GRN_DB))
 
+#define GRN_OBJ_NORMAL_INDEX_COLUMNP(obj) \
+  (obj &&\
+   DB_OBJ(obj)->header.type == GRN_COLUMN_INDEX &&\
+   DB_OBJ(obj)->source_size > 0)
+
 #define GRN_OBJ_FORWARD_INDEX_COLUMNP(obj) \
   (obj &&\
    DB_OBJ(obj)->header.type == GRN_COLUMN_INDEX &&\
-------------- next part --------------
HTML����������������������������...
Download 



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