Kouhei Sutou
null+****@clear*****
Tue Apr 18 11:58:08 JST 2017
Kouhei Sutou 2017-04-18 11:58:08 +0900 (Tue, 18 Apr 2017) New Revision: 3d6eb245b615947885daec6e291dd55e793a0a16 https://github.com/groonga/groonga/commit/3d6eb245b615947885daec6e291dd55e793a0a16 Message: Change ".*" index search enable environment variable name We need to check in scan_info to fall back to sequential search. GRN_II_REGEXP_DOT_ASTERISK_ENABLE -> GRN_SCAN_INFO_REGEXP_DOT_ASTERISK_ENABLE Modified files: lib/expr.c lib/ii.c Modified: lib/expr.c (+16 -0) =================================================================== --- lib/expr.c 2017-04-18 09:38:18 +0900 (8dd8d70) +++ lib/expr.c 2017-04-18 11:58:08 +0900 (e41b79c) @@ -44,6 +44,7 @@ static double grn_table_select_enough_filtered_ratio = 0.0; static int grn_table_select_max_n_enough_filtered_records = 1000; static grn_bool grn_table_select_and_min_skip_enable = GRN_TRUE; +static grn_bool grn_scan_info_regexp_dot_asterisk_enable = GRN_TRUE; void grn_expr_init_from_env(void) @@ -81,6 +82,18 @@ grn_expr_init_from_env(void) grn_table_select_and_min_skip_enable = GRN_TRUE; } } + + { + char grn_scan_info_regexp_dot_asterisk_enable_env[GRN_ENV_BUFFER_SIZE]; + grn_getenv("GRN_SCAN_INFO_REGEXP_DOT_ASTERISK_ENABLE", + grn_scan_info_regexp_dot_asterisk_enable_env, + GRN_ENV_BUFFER_SIZE); + if (strcmp(grn_scan_info_regexp_dot_asterisk_enable_env, "no") == 0) { + grn_scan_info_regexp_dot_asterisk_enable = GRN_FALSE; + } else { + grn_scan_info_regexp_dot_asterisk_enable = GRN_TRUE; + } + } } grn_obj * @@ -4471,6 +4484,9 @@ is_index_searchable_regexp(grn_ctx *ctx, grn_obj *regexp) if (!dot) { return GRN_FALSE; } + if (!grn_scan_info_regexp_dot_asterisk_enable) { + return GRN_FALSE; + } dot = GRN_FALSE; break; case '[' : Modified: lib/ii.c (+1 -15) =================================================================== --- lib/ii.c 2017-04-18 09:38:18 +0900 (7a5a933) +++ lib/ii.c 2017-04-18 11:58:08 +0900 (ddaad60) @@ -101,7 +101,6 @@ static grn_bool grn_ii_overlap_token_skip_enable = GRN_FALSE; static uint32_t grn_ii_builder_block_threshold_force = 0; static uint32_t grn_ii_max_n_segments_small = MAX_PSEG_SMALL; static uint32_t grn_ii_max_n_chunks_small = GRN_II_MAX_CHUNK_SMALL; -static grn_bool grn_ii_regexp_dot_asterisk_enable = GRN_TRUE; void grn_ii_init_from_env(void) @@ -201,18 +200,6 @@ grn_ii_init_from_env(void) } } } - - { - char grn_ii_regexp_dot_asterisk_enable_env[GRN_ENV_BUFFER_SIZE]; - grn_getenv("GRN_II_REGEXP_DOT_ASTERISK_ENABLE", - grn_ii_regexp_dot_asterisk_enable_env, - GRN_ENV_BUFFER_SIZE); - if (strcmp(grn_ii_regexp_dot_asterisk_enable_env, "no") == 0) { - grn_ii_regexp_dot_asterisk_enable = GRN_FALSE; - } else { - grn_ii_regexp_dot_asterisk_enable = GRN_TRUE; - } - } } void @@ -8080,8 +8067,7 @@ grn_ii_parse_regexp_query(grn_ctx *ctx, if (*target == '\\') { escaping = GRN_TRUE; continue; - } else if (grn_ii_regexp_dot_asterisk_enable && - *target == '.' && + } else if (*target == '.' && grn_charlen(ctx, current, string_end) == 1 && *current == '*') { if (GRN_TEXT_LEN(&buffer) > 0) { -------------- next part -------------- HTML����������������������������... Download