1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database

This commit is contained in:
Alexander Barkov
2015-03-16 21:55:10 +04:00
parent 4cb86b79dd
commit e6f67c64cd
13 changed files with 232 additions and 21 deletions

View File

@ -57,6 +57,17 @@ public:
return well_formed_error_pos() ? well_formed_error_pos() :
cannot_convert_error_pos();
}
/*
Convert a string between character sets.
"dstcs" and "srccs" cannot be &my_charset_bin.
*/
uint convert_fix(CHARSET_INFO *dstcs, char *dst, uint dst_length,
CHARSET_INFO *srccs, const char *src, uint src_length,
uint nchars)
{
return my_convert_fix(dstcs, dst, dst_length,
srccs, src, src_length, nchars, this);
}
/*
Copy a string. Fix bad bytes/characters one Unicode conversion,
break on bad bytes in case of non-Unicode copying.