Navigation Menu

Skip to content

Commit

Permalink
Use "grn_obj_is_vector_column()" for decision whether vector column o…
Browse files Browse the repository at this point in the history
…r not.
  • Loading branch information
komainu8 committed Jun 21, 2018
1 parent 755e483 commit 197d92f
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions lib/db.c
Expand Up @@ -8832,29 +8832,21 @@ grn_obj_set_info_source_validate(grn_ctx *ctx, grn_obj *obj, grn_obj *value)
grn_obj *source;

source = grn_ctx_at(ctx, source_ids[0]);
switch (source->header.type) {
case GRN_COLUMN_VAR_SIZE :
switch (source->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) {
case GRN_OBJ_COLUMN_VECTOR :
if ((obj->header.flags & GRN_OBJ_WITH_POSITION)
&& (lexicon_have_tokenizer)) {
if (!(obj->header.flags & GRN_OBJ_WITH_SECTION)) {
char index_name[GRN_TABLE_MAX_KEY_SIZE];
int index_name_size;
index_name_size = grn_obj_name(ctx, obj,
index_name, GRN_TABLE_MAX_KEY_SIZE);
ERR(GRN_INVALID_ARGUMENT,
"grn_obj_set_info(): GRN_INFO_SOURCE: "
"full text index for vector column must be created with WITH_SECTION flag: <%.*s>",
index_name_size, index_name);
goto exit;
}
if (grn_obj_is_vector_column(ctx, source)) {
if ((obj->header.flags & GRN_OBJ_WITH_POSITION)
&& (lexicon_have_tokenizer)) {
if (!(obj->header.flags & GRN_OBJ_WITH_SECTION)) {
char index_name[GRN_TABLE_MAX_KEY_SIZE];
int index_name_size;
index_name_size = grn_obj_name(ctx, obj,
index_name, GRN_TABLE_MAX_KEY_SIZE);
ERR(GRN_INVALID_ARGUMENT,
"grn_obj_set_info(): GRN_INFO_SOURCE: "
"full text index for vector column must be created with WITH_SECTION flag: <%.*s>",
index_name_size, index_name);
goto exit;
}
default:
break;
}
default:
break;
}
}
}
Expand Down

0 comments on commit 197d92f

Please sign in to comment.