mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
SHOW CREATE TABLE didn't display field names in the proper charset
mysys/charset.c: Clear all fields at the end of previous charset
This commit is contained in:
@ -338,6 +338,34 @@ bool String::append(const char *s,uint32 arg_length)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Append a string in the given charset to the string
|
||||
with character set recoding
|
||||
*/
|
||||
|
||||
|
||||
bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs)
|
||||
{
|
||||
if (!arg_length) // Default argument
|
||||
if (!(arg_length= (uint32) strlen(s)))
|
||||
return FALSE;
|
||||
if (str_charset->mbmaxlen > 1)
|
||||
{
|
||||
uint32 add_length=arg_length * str_charset->mbmaxlen;
|
||||
if (realloc(str_length+ add_length))
|
||||
return TRUE;
|
||||
str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset,
|
||||
s, arg_length, cs);
|
||||
return FALSE;
|
||||
}
|
||||
if (realloc(str_length+arg_length))
|
||||
return TRUE;
|
||||
memcpy(Ptr+str_length,s,arg_length);
|
||||
str_length+=arg_length;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
#ifdef TO_BE_REMOVED
|
||||
bool String::append(FILE* file, uint32 arg_length, myf my_flags)
|
||||
{
|
||||
|
Reference in New Issue
Block a user