Navigation Menu

Skip to content

Commit

Permalink
Pass table to selector
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 24, 2012
1 parent 9d241ae commit b0a2c79
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/db.h
Expand Up @@ -153,7 +153,7 @@ typedef struct {
(GRN_TABLE_HASH_KEY <= ((grn_db_obj *)obj)->header.type) &&\
(((grn_db_obj *)obj)->header.type <= GRN_DB))

typedef grn_rc grn_selector_func(grn_ctx *ctx, grn_obj *index,
typedef grn_rc grn_selector_func(grn_ctx *ctx, grn_obj *table, grn_obj *index,
int nargs, grn_obj **args,
grn_obj *res, grn_operator op);

Expand Down
2 changes: 1 addition & 1 deletion lib/expr.c
Expand Up @@ -4267,7 +4267,7 @@ grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
} else if (selector_proc_p(si->args[0])) {
grn_rc rc;
grn_proc *proc = (grn_obj *)(si->args[0]);
rc = proc->selector(ctx, index, si->nargs, si->args,
rc = proc->selector(ctx, table, index, si->nargs, si->args,
res, si->logical_op);
if (rc) {
/* TODO: report error */
Expand Down
8 changes: 4 additions & 4 deletions lib/geo.c
Expand Up @@ -673,7 +673,7 @@ typedef double (*grn_geo_distance_raw_func)(grn_ctx *ctx,
grn_geo_point *point2);

grn_rc
grn_selector_geo_in_circle(grn_ctx *ctx, grn_obj *obj,
grn_selector_geo_in_circle(grn_ctx *ctx, grn_obj *table, grn_obj *index,
int nargs, grn_obj **args,
grn_obj *res, grn_operator op)
{
Expand All @@ -690,7 +690,7 @@ grn_selector_geo_in_circle(grn_ctx *ctx, grn_obj *obj,
grn_obj *center_point, *distance;
center_point = args[2];
distance = args[3];
grn_geo_select_in_circle(ctx, obj, center_point, distance, type, res, op);
grn_geo_select_in_circle(ctx, index, center_point, distance, type, res, op);
}
break;
default :
Expand Down Expand Up @@ -884,15 +884,15 @@ exit :
}

grn_rc
grn_selector_geo_in_rectangle(grn_ctx *ctx, grn_obj *obj,
grn_selector_geo_in_rectangle(grn_ctx *ctx, grn_obj *table, grn_obj *index,
int nargs, grn_obj **args,
grn_obj *res, grn_operator op)
{
if (nargs == 4) {
grn_obj *top_left_point, *bottom_right_point;
top_left_point = args[2];
bottom_right_point = args[3];
grn_geo_select_in_rectangle(ctx, obj,
grn_geo_select_in_rectangle(ctx, index,
top_left_point, bottom_right_point,
res, op);
} else {
Expand Down
5 changes: 3 additions & 2 deletions lib/geo.h
Expand Up @@ -133,10 +133,11 @@ grn_rc grn_geo_select_in_circle(grn_ctx *ctx,
grn_obj *res,
grn_operator op);

grn_rc grn_selector_geo_in_circle(grn_ctx *ctx, grn_obj *obj,
grn_rc grn_selector_geo_in_circle(grn_ctx *ctx, grn_obj *table, grn_obj *index,
int nargs, grn_obj **args,
grn_obj *res, grn_operator op);
grn_rc grn_selector_geo_in_rectangle(grn_ctx *ctx, grn_obj *obj,
grn_rc grn_selector_geo_in_rectangle(grn_ctx *ctx,
grn_obj *table, grn_obj *index,
int nargs, grn_obj **args,
grn_obj *res, grn_operator op);

Expand Down

0 comments on commit b0a2c79

Please sign in to comment.