diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-07-19 22:22:14 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-07-20 20:13:28 +0200 |
commit | 2fcd8c12522f5f935066b661c42b5b7cb416d148 (patch) | |
tree | 5f2aac47caeaec71df6943f8120b2ff3727413ab /sql/item_strfunc.cc | |
parent | dc8b2fb03a5a2dff4687eb8dad042b34730b5210 (diff) | |
download | mariadb-git-2fcd8c12522f5f935066b661c42b5b7cb416d148.tar.gz |
MDEV-13173 An RLIKE that previously worked on 10.0 now returns "Got error 'pcre_exec: recursion limit of 100 exceeded' from regexp"
1. use Regexp_processor_pcre::set_recursion_limit() to set the
recursion limit depending on the current available stack size
2. make pcre stack frame to be estimated no less than 500 bytes.
sometimes pcre estimates it too low, even though the manual
says 500+16 bytes (it was estimated only 188 for me, actual
frame size was 512).
3. do it for embedded too
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 22e13bf6c38..c3043adac47 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1343,6 +1343,13 @@ void Item_func_replace::fix_length_and_dec() /*********************************************************************/ +bool Item_func_regexp_replace::fix_fields(THD *thd, Item **ref) +{ + re.set_recursion_limit(thd); + return Item_str_func::fix_fields(thd, ref); +} + + void Item_func_regexp_replace::fix_length_and_dec() { if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 3)) @@ -1478,6 +1485,13 @@ err: } +bool Item_func_regexp_substr::fix_fields(THD *thd, Item **ref) +{ + re.set_recursion_limit(thd); + return Item_str_func::fix_fields(thd, ref); +} + + void Item_func_regexp_substr::fix_length_and_dec() { if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 2)) |