Adding a new parameter for well_formed_length to

return error. We'll use it for better warnign reporting.
This commit is contained in:
bar@mysql.com 2005-04-06 11:53:15 +05:00
commit 0134a2b286
12 changed files with 57 additions and 27 deletions

View file

@ -264,18 +264,21 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
}
uint my_well_formed_len_mb(CHARSET_INFO *cs,
const char *b, const char *e, uint pos)
uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
uint pos, int *error)
{
const char *b_start= b;
*error= 0;
while (pos)
{
my_wc_t wc;
int mblen;
if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0)
{
*error= 1;
break;
}
b+= mblen;
pos--;
}