mirror of
https://github.com/MariaDB/server.git
synced 2026-05-05 14:45:31 +02:00
Adding a new parameter for well_formed_length to
return error. We'll use it for better warnign reporting.
This commit is contained in:
parent
014c8829cb
commit
0134a2b286
12 changed files with 57 additions and 27 deletions
|
|
@ -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--;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue