summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-08-09 08:56:11 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2017-08-09 08:56:11 +0300
commit56b03e308fb4c0feee166ddf6a707d855affa3c3 (patch)
treefc4e16093800cf4cbf1cc54fceb0b7280c4212ba /sql/mysqld.cc
parent4f40f87c48a9ee252f797b5d760a6b6f07cc3815 (diff)
parenta346a5613ee7c0b17b0b4ce377659c996ef6bb75 (diff)
downloadmariadb-git-56b03e308fb4c0feee166ddf6a707d855affa3c3.tar.gz
Merge tag 'mariadb-10.0.32' into 10.0-galera
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index baf3d0f6758..45e6b3666bf 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3619,7 +3619,6 @@ sizeof(load_default_groups)/sizeof(load_default_groups[0]);
#endif
-#ifndef EMBEDDED_LIBRARY
/**
This function is used to check for stack overrun for pathological
cases of regular expressions and 'like' expressions.
@@ -3648,8 +3647,6 @@ check_enough_stack_size(int recurse_level)
return 0;
return check_enough_stack_size_slow();
}
-#endif
-
/*
@@ -3671,11 +3668,12 @@ static void init_pcre()
{
pcre_malloc= pcre_stack_malloc= my_str_malloc_mysqld;
pcre_free= pcre_stack_free= my_str_free_mysqld;
-#ifndef EMBEDDED_LIBRARY
pcre_stack_guard= check_enough_stack_size_slow;
/* See http://pcre.org/original/doc/html/pcrestack.html */
- my_pcre_frame_size= -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) + 16;
-#endif
+ my_pcre_frame_size= -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0);
+ // pcre can underestimate its stack usage. Use a safe value, as in the manual
+ set_if_bigger(my_pcre_frame_size, 500);
+ my_pcre_frame_size += 16; // Again, safety margin, see the manual
}