| 10150 | |
| 10151 | |
| 10152 | bool check_string_char_length(const LEX_CSTRING *str, uint err_msg, |
| 10153 | size_t max_char_length, CHARSET_INFO *cs, |
| 10154 | bool no_error) |
| 10155 | { |
| 10156 | Well_formed_prefix prefix(cs, str->str, str->length, max_char_length); |
| 10157 | if (likely(!prefix.well_formed_error_pos() && |
| 10158 | str->length == prefix.length())) |
| 10159 | return FALSE; |
| 10160 | |
| 10161 | if (!no_error) |
| 10162 | { |
| 10163 | ErrConvString err(str->str, str->length, cs); |
| 10164 | my_error(ER_WRONG_STRING_LENGTH, MYF(0), err.ptr(), |
| 10165 | err_msg ? ER(err_msg) : "", |
| 10166 | max_char_length); |
| 10167 | } |
| 10168 | return TRUE; |
| 10169 | } |
| 10170 | |
| 10171 | |
| 10172 | bool check_ident_length(const LEX_CSTRING *ident) |
no test coverage detected