Skip to content

Commit

Permalink
Added support for GRN_QUERY_BUT operator to grn_table_select().
Browse files Browse the repository at this point in the history
  • Loading branch information
daijiro committed Sep 16, 2009
1 parent e36db5b commit 5175c1b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/db.c
Expand Up @@ -7436,13 +7436,20 @@ grn_expr_exec(grn_ctx *ctx, grn_obj *expr, int nargs)
}
code++;
break;
case GRN_OP_ADJUST :
case GRN_OP_BUT :
{
/* todo */
grn_obj *x, *y;
POP2ALLOC1(x, y, res);
if (GRN_INT32_VALUE(x) == 0 || GRN_INT32_VALUE(y) == 1) {
GRN_INT32_SET(ctx, res, 0);
} else {
GRN_INT32_SET(ctx, res, 1);
}
res->header.domain = GRN_DB_INT32;
}
code++;
break;
case GRN_OP_BUT :
case GRN_OP_ADJUST :
{
/* todo */
}
Expand Down Expand Up @@ -7807,6 +7814,7 @@ scan_info_build(grn_ctx *ctx, grn_obj *table, grn_obj *expr, int *n, grn_operato
break;
case GRN_OP_AND :
case GRN_OP_OR :
case GRN_OP_BUT :
if (stat != SCAN_OP) { return NULL; }
stat = SCAN_START;
break;
Expand Down Expand Up @@ -7869,6 +7877,7 @@ scan_info_build(grn_ctx *ctx, grn_obj *table, grn_obj *expr, int *n, grn_operato
break;
case GRN_OP_AND :
case GRN_OP_OR :
case GRN_OP_BUT :
if (i) { sis[i - 1]->logical_op = c->op; }
stat = SCAN_START;
break;
Expand Down

0 comments on commit 5175c1b

Please sign in to comment.