summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorDaniel Black <daniel.black@au.ibm.com>2017-04-18 17:20:34 +1000
committerSergei Golubchik <serg@mariadb.org>2017-05-15 22:23:10 +0200
commit602b5e4c498ad2e2d045adfa4fd1478ac437582a (patch)
tree3e91ba4fab05d00c207adcebe1df68de661d3c63 /sql/item_cmpfunc.h
parentb30311e52a614a199e54767bb77d0419ad2d49c1 (diff)
downloadmariadb-git-602b5e4c498ad2e2d045adfa4fd1478ac437582a.tar.gz
WIP: global readonly variable pcre_frame_size
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index bd552bfc952..b5b94888330 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -25,6 +25,7 @@
#include "thr_malloc.h" /* sql_calloc */
#include "item_func.h" /* Item_int_func, Item_bool_func */
+long check_stack_available(long margin, uchar *dummy);
#define PCRE_STATIC 1 /* Important on Windows */
#include "pcre.h" /* pcre header file */
@@ -1576,8 +1577,13 @@ public:
m_library_charset(&my_charset_utf8_general_ci),
m_subpatterns_needed(0)
{
+#ifndef EMBEDDED_LIBRARY
+ uchar dummy;
m_pcre_extra.flags= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
- m_pcre_extra.match_limit_recursion= 100L;
+ m_pcre_extra.match_limit_recursion= check_stack_available(100, &dummy) / my_pcre_frame_size;
+#else
+ m_pcre_extra.flags= 0L;
+#endif
}
int default_regex_flags();
void init(CHARSET_INFO *data_charset, int extra_flags, uint nsubpatterns)