Navigation Menu

Skip to content

Commit

Permalink
mrb: add prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 8, 2014
1 parent f8ee0a8 commit 031d848
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/mrb/mrb_expr.c
Expand Up @@ -353,7 +353,7 @@ scan_info_build(grn_ctx *ctx, grn_obj *expr, int *n,
mrb_funcall(mrb, mrb_si, "op=", 1, mrb_fixnum_value(c->op));
mrb_funcall(mrb, mrb_si, "end=", 1, mrb_fixnum_value(c - e->codes));
sis[i++] = si;
mrb_funcall(mrb, mrb_si, "resolve_indexes", 0);
mrb_funcall(mrb, mrb_si, "call_relational_resolve_indexes", 0);
si = NULL;
} else {
stat = SCAN_COL2;
Expand Down
14 changes: 7 additions & 7 deletions lib/mrb/scripts/scan_info.rb
Expand Up @@ -18,32 +18,32 @@ def each_arg
nil
end

def resolve_indexes
def call_relational_resolve_indexes
# better index resolving framework for functions should be implemented
each_arg do |arg|
resolve_index(arg)
call_relational_resolve_index(arg)
end
end

private
def resolve_index(object)
def call_relational_resolve_index(object)
case object
when Accessor
resolve_index_accessor(object)
call_relational_resolve_index_accessor(object)
when Bulk
self.query = object
else
resolve_index_db_obj(object)
call_relational_resolve_index_db_obj(object)
end
end

def resolve_index_db_obj(db_obj)
def call_relational_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 resolve_index_accessor(accessor)
def call_relational_resolve_index_accessor(accessor)
self.flags |= Flags::ACCESSOR
index_info = accessor.find_index(op)
return if index_info.nil?
Expand Down

0 comments on commit 031d848

Please sign in to comment.