Navigation Menu

Skip to content

Commit

Permalink
Follow grn_snip API change
Browse files Browse the repository at this point in the history
It requires Groonga 4.0.0. So we should update
required_groonga_version but we don't it yet. Because Groonga's
base_version isn't updated yet.

TODO: We should update required_groonga_version after Groonga's
version is 4.0.0.
  • Loading branch information
kou committed Feb 3, 2014
1 parent cab8e0c commit 3466d17
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions udf/mrn_udf_snippet.cpp
Expand Up @@ -2,7 +2,7 @@
/*
Copyright(C) 2010 Tetsuro IKEDA
Copyright(C) 2010-2013 Kentoku SHIBA
Copyright(C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
Copyright(C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -32,12 +32,12 @@ MRN_BEGIN_DECLS
struct st_mrn_snip_info
{
grn_ctx ctx;
grn_snip *snippet;
grn_obj *snippet;
String result_str;
};

static my_bool mrn_snippet_prepare(st_mrn_snip_info *snip_info, UDF_ARGS *args,
char *message, grn_snip **snippet)
char *message, grn_obj **snippet)
{
unsigned int i;
CHARSET_INFO *cs;
Expand Down Expand Up @@ -115,7 +115,7 @@ static my_bool mrn_snippet_prepare(st_mrn_snip_info *snip_info, UDF_ARGS *args,

error:
if (*snippet) {
grn_snip_close(ctx, *snippet);
grn_obj_close(ctx, *snippet);
}
return TRUE;
}
Expand Down Expand Up @@ -211,7 +211,7 @@ MRN_API char *mroonga_snippet(UDF_INIT *initid, UDF_ARGS *args, char *result,
String *result_str = &snip_info->result_str;
char *target;
unsigned int target_length;
grn_snip *snippet = NULL;
grn_obj *snippet = NULL;
grn_rc rc;
unsigned int i, n_results, max_tagged_length, result_length;

Expand Down Expand Up @@ -269,7 +269,7 @@ MRN_API char *mroonga_snippet(UDF_INIT *initid, UDF_ARGS *args, char *result,
}

if (!snip_info->snippet) {
rc = grn_snip_close(ctx, snippet);
rc = grn_obj_close(ctx, snippet);
if (rc) {
my_printf_error(ER_MRN_ERROR_FROM_GROONGA_NUM,
ER_MRN_ERROR_FROM_GROONGA_STR, MYF(0), ctx->errbuf);
Expand All @@ -290,7 +290,7 @@ MRN_API void mroonga_snippet_deinit(UDF_INIT *initid)
st_mrn_snip_info *snip_info = (st_mrn_snip_info *) initid->ptr;
if (snip_info) {
if (snip_info->snippet) {
grn_snip_close(&snip_info->ctx, snip_info->snippet);
grn_obj_close(&snip_info->ctx, snip_info->snippet);
}
snip_info->result_str.free();
grn_obj_close(&snip_info->ctx, grn_ctx_db(&snip_info->ctx));
Expand Down

0 comments on commit 3466d17

Please sign in to comment.