diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-05-07 13:05:09 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-05-07 13:05:09 +0200 |
commit | b381cf843c841151f96541b19bd753cd3bbae326 (patch) | |
tree | dfc377a1dfbd4d2044a0b799ff5ed6411c7e864f /strings/ctype-bin.c | |
parent | d4be9e7bc0cfd5ddd444ecc64daa4166597ca2eb (diff) | |
parent | e5055e22f1f311fa48457cfcc97b72e93a37329f (diff) | |
download | mariadb-git-b381cf843c841151f96541b19bd753cd3bbae326.tar.gz |
mysql-5.5.31 merge
Diffstat (limited to 'strings/ctype-bin.c')
-rw-r--r-- | strings/ctype-bin.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index d28d576c661..88a7f8b84e8 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -318,13 +318,16 @@ void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)), #define INC_PTR(cs,A,B) (A)++ -int my_wildcmp_bin(CHARSET_INFO *cs, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape, int w_one, int w_many) +static +int my_wildcmp_bin_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 */ - + + if (my_string_stack_guard && my_string_stack_guard(recurse_level)) + return 1; while (wildstr != wildend) { while (*wildstr != w_many && *wildstr != w_one) @@ -383,8 +386,8 @@ int my_wildcmp_bin(CHARSET_INFO *cs, if (str++ == str_end) return(-1); { - int tmp=my_wildcmp_bin(cs,str,str_end,wildstr,wildend,escape,w_one, - w_many); + int tmp=my_wildcmp_bin_impl(cs,str,str_end,wildstr,wildend,escape,w_one, + w_many, recurse_level + 1); if (tmp <= 0) return(tmp); } @@ -395,6 +398,16 @@ int my_wildcmp_bin(CHARSET_INFO *cs, return(str != str_end ? 1 : 0); } +int my_wildcmp_bin(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_bin_impl(cs, str, str_end, + wildstr, wildend, + escape, w_one, w_many, 1); +} + static size_t my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)), uchar *dest, size_t dstlen, |