Skip to content

Commit

Permalink
Fixed a problem in grn_expr_snip() cause parse error.
Browse files Browse the repository at this point in the history
  • Loading branch information
daijiro committed Oct 1, 2009
1 parent 3ffa3fa commit 55fb9b1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/ctx.c
Expand Up @@ -845,6 +845,8 @@ grn_ctx_recv(grn_ctx *ctx, char **str, unsigned int *str_len, int *flags)
{
if (!ctx) { return GRN_INVALID_ARGUMENT; }
if (ctx->stat == GRN_CTX_QUIT) {
*str = NULL;
*str_len = 0;
*flags = GRN_CTX_QUIT;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/db.c
Expand Up @@ -10584,7 +10584,7 @@ grn_expr_snip(grn_ctx *ctx, grn_obj *expr, int flags,
scan_info **sis, *si;
grn_snip *res = NULL;
GRN_API_ENTER;
if ((sis = scan_info_build(ctx, expr, &n, GRN_OP_OR, 1))) {
if ((sis = scan_info_build(ctx, expr, &n, GRN_OP_OR, 0))) {
if ((res = grn_snip_open(ctx, flags, width, max_results,
NULL, 0, NULL, 0, mapping))) {
int butp = 0, nparens = 0, npbut = 0;
Expand Down
1 change: 1 addition & 0 deletions lib/token.h
Expand Up @@ -55,6 +55,7 @@ typedef struct {
grn_encoding encoding;
grn_obj *tokenizer;
grn_proc_ctx pctx;
uint32_t variant;
} grn_token;

enum {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/core/test-expr.c
Expand Up @@ -1172,7 +1172,7 @@ test_expr_snip(void)
GRN_EXPR_CREATE_FOR_QUERY(&context, docs, expr, v);
cut_assert_not_null(expr);

PARSE(expr, "search OR engine OR column", 1);
PARSE(expr, "search engine column", 1);

{
grn_snip *snip;
Expand Down

0 comments on commit 55fb9b1

Please sign in to comment.