mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Change CHARSET_INFO character set and collaction names to LEX_CSTRING
This change removed 68 explict strlen() calls from the code. The following renames was done to ensure we don't use the old names when merging code from earlier releases, as using the new variables for print function could result in crashes: - charset->csname renamed to charset->cs_name - charset->name renamed to charset->coll_name Almost everything where mechanical changes except: - Changed to use the new Protocol::store(LEX_CSTRING..) when possible - Changed to use field->store(LEX_CSTRING*, CHARSET_INFO*) when possible - Changed to use String->append(LEX_CSTRING&) when possible Other things: - There where compiler issues with ensuring that all character set names points to the same string: gcc doesn't allow one to use integer constants when defining global structures (constant char * pointers works fine). To get around this, I declared defines for each character set name length.
This commit is contained in:
@ -2344,7 +2344,7 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
|
||||
{
|
||||
my_error(ER_BAD_DATA, MYF(0),
|
||||
ErrConvString(from, from_length, from_cs).ptr(),
|
||||
to_cs->csname);
|
||||
to_cs->cs_name.str);
|
||||
DBUG_RETURN(true);
|
||||
}
|
||||
DBUG_RETURN(false);
|
||||
@ -2396,7 +2396,8 @@ public:
|
||||
if (most_important_error_pos())
|
||||
{
|
||||
ErrConvString err(src, src_length, &my_charset_bin);
|
||||
my_error(ER_INVALID_CHARACTER_STRING, MYF(0), srccs->csname, err.ptr());
|
||||
my_error(ER_INVALID_CHARACTER_STRING, MYF(0), srccs->cs_name.str,
|
||||
err.ptr());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -2464,7 +2465,7 @@ bool THD::check_string_for_wellformedness(const char *str,
|
||||
if (wlen < length)
|
||||
{
|
||||
ErrConvString err(str, length, &my_charset_bin);
|
||||
my_error(ER_INVALID_CHARACTER_STRING, MYF(0), cs->csname, err.ptr());
|
||||
my_error(ER_INVALID_CHARACTER_STRING, MYF(0), cs->cs_name.str, err.ptr());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user