mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-12659 Add THD::make_string_literal()
This commit is contained in:
@ -2352,6 +2352,26 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
|
||||
}
|
||||
|
||||
|
||||
Item_string *THD::make_string_literal(const char *str, size_t length,
|
||||
uint repertoire)
|
||||
{
|
||||
if (!charset_is_collation_connection &&
|
||||
(repertoire != MY_REPERTOIRE_ASCII ||
|
||||
!my_charset_is_ascii_based(variables.collation_connection)))
|
||||
{
|
||||
LEX_STRING to;
|
||||
if (convert_string(&to, variables.collation_connection,
|
||||
str, length, variables.character_set_client))
|
||||
return NULL;
|
||||
str= to.str;
|
||||
length= to.length;
|
||||
}
|
||||
return new (mem_root) Item_string(this, str, length,
|
||||
variables.collation_connection,
|
||||
DERIVATION_COERCIBLE, repertoire);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Update some cache variables when character set changes
|
||||
*/
|
||||
|
Reference in New Issue
Block a user