[Groonga-commit] groonga/groonga [master] Fixed a bug in grn_table_select() causing GRN_OP_EQUAL to not work correctly.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 8月 25日 (水) 19:46:51 JST


Daijiro MORI	2010-08-25 10:46:51 +0000 (Wed, 25 Aug 2010)

  New Revision: 4b8eb2a6eec26b3a11d3385b728f9e01b83dfc3e

  Log:
    Fixed a bug in grn_table_select() causing GRN_OP_EQUAL to not work correctly.

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

  Modified: lib/db.c (+1 -1)
===================================================================
--- lib/db.c    2010-08-25 09:36:45 +0000 (9b67bb6)
+++ lib/db.c    2010-08-25 10:46:51 +0000 (e1e3a5f)
@@ -2763,7 +2763,7 @@ grn_column_create(grn_ctx *ctx, grn_obj *table,
     }
     break;
   case GRN_OBJ_COLUMN_VECTOR :
-    res = (grn_obj *)grn_ja_create(ctx, path, value_size * 16/*todo*/, flags);
+    res = (grn_obj *)grn_ja_create(ctx, path, value_size * 30/*todo*/, flags);
     //todo : zlib support
     break;
   case GRN_OBJ_COLUMN_INDEX :

  Modified: lib/expr.c (+12 -5)
===================================================================
--- lib/expr.c    2010-08-25 09:36:45 +0000 (78535b4)
+++ lib/expr.c    2010-08-25 10:46:51 +0000 (dc27637)
@@ -3866,11 +3866,18 @@ grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
                   }
                 }
               } else {
-                /* table ?? si->index.domain ? */
-                grn_id tid = grn_table_get(ctx, table,
-                                           GRN_BULK_HEAD(si->query),
-                                           GRN_BULK_VSIZE(si->query));
-                grn_ii_at(ctx, (grn_ii *)index, tid, (grn_hash *)res, si->logical_op);
+                grn_obj *domain = grn_ctx_at(ctx, index->header.domain);
+                if (domain) {
+                  grn_id tid;
+                  if (GRN_OBJ_GET_DOMAIN(si->query) == DB_OBJ(domain)->id) {
+                    tid = GRN_RECORD_VALUE(si->query);
+                  } else {
+                    tid = grn_table_get(ctx, domain,
+                                        GRN_BULK_HEAD(si->query),
+                                        GRN_BULK_VSIZE(si->query));
+                  }
+                  grn_ii_at(ctx, (grn_ii *)index, tid, (grn_hash *)res, si->logical_op);
+                }
                 grn_ii_resolve_sel_and(ctx, (grn_hash *)res, si->logical_op);
                 done++;
               }




Groonga-commit メーリングリストの案内
Back to archive index