mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31531 Remove my_casedn_str() and my_caseup_str()
Under terms of MDEV 27490 we'll add support for non-BMP identifiers and upgrade casefolding information to Unicode version 14.0.0. In Unicode-14.0.0 conversion to lower and upper cases can increase octet length of the string, so conversion won't be possible in-place any more. This patch removes virtual functions performing in-place casefolding: - my_charset_handler_st::casedn_str() - my_charset_handler_st::caseup_str() and fixes the code to use the non-inplace functions instead: - my_charset_handler_st::casedn() - my_charset_handler_st::caseup()
This commit is contained in:
@@ -1030,6 +1030,24 @@ public:
|
||||
set_charset(tocs);
|
||||
return false;
|
||||
}
|
||||
bool copy_casedn(CHARSET_INFO *cs, const LEX_CSTRING &str)
|
||||
{
|
||||
size_t nbytes= str.length * cs->casedn_multiply();
|
||||
DBUG_ASSERT(nbytes + 1 <= UINT_MAX32);
|
||||
if (alloc(nbytes))
|
||||
return true;
|
||||
str_length= (uint32) cs->casedn_z(str.str, str.length, Ptr, nbytes + 1);
|
||||
return false;
|
||||
}
|
||||
bool copy_caseup(CHARSET_INFO *cs, const LEX_CSTRING &str)
|
||||
{
|
||||
size_t nbytes= str.length * cs->caseup_multiply();
|
||||
DBUG_ASSERT(nbytes + 1 <= UINT_MAX32);
|
||||
if (alloc(nbytes))
|
||||
return true;
|
||||
str_length= (uint32) cs->caseup_z(str.str, str.length, Ptr, nbytes + 1);
|
||||
return false;
|
||||
}
|
||||
// Append without character set conversion
|
||||
bool append(const String &s)
|
||||
{
|
||||
|
Reference in New Issue
Block a user