mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 03:47:17 +02:00
Problem fix:
http://bugs.mysql.com/bug.php?id=2366 Wrong utf8 behaviour when data is trancated
This commit is contained in:
parent
d200443bed
commit
d13ad0822e
20 changed files with 105 additions and 28 deletions
|
|
@ -274,6 +274,22 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
|
|||
return pos ? e+2-b0 : b-b0;
|
||||
}
|
||||
|
||||
uint my_wellformedlen_mb(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char *b, const char *e, uint pos)
|
||||
{
|
||||
uint mblen;
|
||||
const char *b0=b;
|
||||
|
||||
while (pos && b<e)
|
||||
{
|
||||
b+= (mblen= my_ismbchar(cs,b,e)) ? mblen : 1;
|
||||
pos--;
|
||||
}
|
||||
return b-b0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint my_instr_mb(CHARSET_INFO *cs,
|
||||
const char *b, uint b_length,
|
||||
const char *s, uint s_length,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue