summaryrefslogtreecommitdiff
path: root/sql/strfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/strfunc.cc')
-rw-r--r--sql/strfunc.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index 99ff9c50588..58647c21e44 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -79,14 +79,17 @@ ulonglong find_set(TYPELIB *lib, const char *str, size_t length, CHARSET_INFO *c
var_len= (uint) (pos - start);
uint find= cs ? find_type2(lib, start, var_len, cs) :
find_type(lib, start, var_len, (bool) 0);
- if (unlikely(!find && *err_len == 0))
+ if (unlikely(!find))
{
- // report the first error with length > 0
- *err_pos= (char*) start;
- *err_len= var_len;
- *set_warning= 1;
+ if (*err_len == 0)
+ {
+ // report the first error with length > 0
+ *err_pos= (char*) start;
+ *err_len= var_len;
+ *set_warning= 1;
+ }
}
- else
+ else if (find <= sizeof(longlong) * 8)
found|= 1ULL << (find - 1);
if (pos >= end)
break;
@@ -400,4 +403,3 @@ const char *flagset_to_string(THD *thd, LEX_CSTRING *result, ulonglong set,
return result->str;
}
-