summaryrefslogtreecommitdiff
path: root/strings/ctype-uca.c
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-05-07 13:05:09 +0200
committerSergei Golubchik <sergii@pisem.net>2013-05-07 13:05:09 +0200
commitb381cf843c841151f96541b19bd753cd3bbae326 (patch)
treedfc377a1dfbd4d2044a0b799ff5ed6411c7e864f /strings/ctype-uca.c
parentd4be9e7bc0cfd5ddd444ecc64daa4166597ca2eb (diff)
parente5055e22f1f311fa48457cfcc97b72e93a37329f (diff)
downloadmariadb-git-b381cf843c841151f96541b19bd753cd3bbae326.tar.gz
mysql-5.5.31 merge
Diffstat (limited to 'strings/ctype-uca.c')
-rw-r--r--strings/ctype-uca.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index e4a8d7a4067..020cfdfcbbe 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -7487,16 +7487,18 @@ static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2)
*/
static
-int my_wildcmp_uca(CHARSET_INFO *cs,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many)
+int my_wildcmp_uca_impl(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many, int recurse_level)
{
int result= -1; /* Not found, using wildcards */
my_wc_t s_wc, w_wc;
int scan;
my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc;
+ if (my_string_stack_guard && my_string_stack_guard(recurse_level))
+ return 1;
while (wildstr != wildend)
{
while (1)
@@ -7603,8 +7605,8 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
if (str == str_end)
return -1;
- result= my_wildcmp_uca(cs, str, str_end, wildstr, wildend,
- escape, w_one, w_many);
+ result= my_wildcmp_uca_impl(cs, str, str_end, wildstr, wildend,
+ escape, w_one, w_many, recurse_level+1);
if (result <= 0)
return result;
@@ -7616,6 +7618,16 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
return (str != str_end ? 1 : 0);
}
+int my_wildcmp_uca(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many)
+{
+ return my_wildcmp_uca_impl(cs, str, str_end,
+ wildstr, wildend,
+ escape, w_one, w_many, 1);
+}
+
/*
Collation language is implemented according to