Skip to content

Commit

Permalink
cleanup: remove Regexp_processor_pcre::m_subpatterns_needed
Browse files Browse the repository at this point in the history
it's unused now.
  • Loading branch information
vuvova committed May 29, 2017
1 parent 2372bfa commit 5e0038b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions sql/item_cmpfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5589,7 +5589,7 @@ Item_func_regex::fix_length_and_dec()
if (agg_arg_charsets_for_comparison(cmp_collation, args, 2))
return;

re.init(cmp_collation.collation, 0, 0);
re.init(cmp_collation.collation, 0);
re.fix_owner(this, args[0], args[1]);
}

Expand All @@ -5613,7 +5613,7 @@ Item_func_regexp_instr::fix_length_and_dec()
if (agg_arg_charsets_for_comparison(cmp_collation, args, 2))
return;

re.init(cmp_collation.collation, 0, 1);
re.init(cmp_collation.collation, 0);
re.fix_owner(this, args[0], args[1]);
}

Expand Down
7 changes: 2 additions & 5 deletions sql/item_cmpfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,6 @@ class Regexp_processor_pcre
String m_prev_pattern;
int m_pcre_exec_rc;
int m_SubStrVec[30];
uint m_subpatterns_needed;
void pcre_exec_warn(int rc) const;
int pcre_exec_with_warn(const pcre *code, const pcre_extra *extra,
const char *subject, int length, int startoffset,
Expand All @@ -1915,15 +1914,14 @@ class Regexp_processor_pcre
m_pcre(NULL), m_conversion_is_needed(true), m_is_const(0),
m_library_flags(0),
m_data_charset(&my_charset_utf8_general_ci),
m_library_charset(&my_charset_utf8_general_ci),
m_subpatterns_needed(0)
m_library_charset(&my_charset_utf8_general_ci)
{
m_pcre_extra.flags= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
m_pcre_extra.match_limit_recursion= 100L;
}
int default_regex_flags();
void set_recursion_limit(THD *);
void init(CHARSET_INFO *data_charset, int extra_flags, uint nsubpatterns_arg)
void init(CHARSET_INFO *data_charset, int extra_flags)
{
m_library_flags= default_regex_flags() | extra_flags |
(data_charset != &my_charset_bin ?
Expand All @@ -1937,7 +1935,6 @@ class Regexp_processor_pcre

m_conversion_is_needed= (data_charset != &my_charset_bin) &&
!my_charset_same(data_charset, m_library_charset);
m_subpatterns_needed= nsubpatterns_arg;
}
void fix_owner(Item_func *owner, Item *subject_arg, Item *pattern_arg);
bool compile(String *pattern, bool send_error);
Expand Down
4 changes: 2 additions & 2 deletions sql/item_strfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ void Item_func_regexp_replace::fix_length_and_dec()
if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 3))
return;
max_length= MAX_BLOB_WIDTH;
re.init(collation.collation, 0, 10);
re.init(collation.collation, 0);
re.fix_owner(this, args[0], args[1]);
}

Expand Down Expand Up @@ -1413,7 +1413,7 @@ void Item_func_regexp_substr::fix_length_and_dec()
if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 2))
return;
fix_char_length(args[0]->max_char_length());
re.init(collation.collation, 0, 10);
re.init(collation.collation, 0);
re.fix_owner(this, args[0], args[1]);
}

Expand Down

0 comments on commit 5e0038b

Please sign in to comment.