mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-7661 Unexpected result for: CAST(0xHHHH AS CHAR CHARACTER SET xxx)
for incorrect byte sequences
This commit is contained in:
@ -200,6 +200,7 @@ public:
|
||||
inline bool is_empty() const { return (str_length == 0); }
|
||||
inline void mark_as_const() { Alloced_length= 0;}
|
||||
inline const char *ptr() const { return Ptr; }
|
||||
inline const char *end() const { return Ptr + str_length; }
|
||||
inline char *c_ptr()
|
||||
{
|
||||
DBUG_ASSERT(!alloced || !Ptr || !Alloced_length ||
|
||||
@ -423,6 +424,17 @@ public:
|
||||
{
|
||||
return copy(str->ptr(), str->length(), str->charset(), tocs, errors);
|
||||
}
|
||||
bool copy(CHARSET_INFO *tocs,
|
||||
CHARSET_INFO *fromcs, const char *src, uint32 src_length,
|
||||
uint32 nchars, String_copier *copier)
|
||||
{
|
||||
if (alloc(tocs->mbmaxlen * src_length))
|
||||
return true;
|
||||
str_length= copier->well_formed_copy(tocs, Ptr, Alloced_length,
|
||||
fromcs, src, src_length, nchars);
|
||||
str_charset= tocs;
|
||||
return false;
|
||||
}
|
||||
void move(String &s)
|
||||
{
|
||||
free();
|
||||
|
Reference in New Issue
Block a user