summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-08-08 10:18:43 +0200
committerSergei Golubchik <serg@mariadb.org>2017-08-08 10:18:43 +0200
commit8e8d42ddf0291b2364fef8e3224e65d596ef4202 (patch)
tree056e6f1c489477cb7e1c285924e88f8f02e5918b /sql/mysqld.cc
parent2395adfbfd6b4425981053f074865769414b5614 (diff)
parentef2e51c39637ace64b66fa82b834e31f0e4ef38a (diff)
downloadmariadb-git-8e8d42ddf0291b2364fef8e3224e65d596ef4202.tar.gz
Merge branch '10.0' into 10.1
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 e363c6de3f1..3af8750de13 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3587,7 +3587,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.
@@ -3616,8 +3615,6 @@ check_enough_stack_size(int recurse_level)
return 0;
return check_enough_stack_size_slow();
}
-#endif
-
/*
@@ -3639,11 +3636,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
}