Navigation Menu

Skip to content

Commit

Permalink
mrb: implement resolving index on match operation
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 8, 2014
1 parent 031d848 commit 8a81705
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/mrb/mrb_expr.c
Expand Up @@ -237,12 +237,8 @@ scan_info_build(grn_ctx *ctx, grn_obj *expr, int *n,
}
}
} else if (GRN_DB_OBJP(*p)) {
if (grn_column_index(ctx, *p, c->op, &index, 1, &sid)) {
mrb_funcall(mrb, mrb_si, "put_index", 3,
mrb_cptr_value(mrb, index),
mrb_fixnum_value(sid),
mrb_fixnum_value(1));
}
mrb_value mrb_db_obj = grn_mrb_value_from_grn_obj(mrb, *p);
mrb_funcall(mrb, mrb_si, "match_resolve_index_db_obj", 1, mrb_db_obj);
} else if (GRN_ACCESSORP(*p)) {
grn_scan_info_set_flags(si, grn_scan_info_get_flags(si) | SCAN_ACCESSOR);
if (grn_column_index(ctx, *p, c->op, &index, 1, &sid)) {
Expand Down
6 changes: 6 additions & 0 deletions lib/mrb/scripts/scan_info.rb
Expand Up @@ -18,6 +18,12 @@ def each_arg
nil
end

def match_resolve_index_db_obj(db_obj)
index_info = db_obj.find_index(op)
return if index_info.nil?
put_index(index_info.index, index_info.section_id, 1)
end

def call_relational_resolve_indexes
# better index resolving framework for functions should be implemented
each_arg do |arg|
Expand Down

0 comments on commit 8a81705

Please sign in to comment.