1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-32002 Remove my_casedn_str() in append_identifier() context

- Adding a helper function append_identifier_opt_casedn()

- Reusing it in:

    Item_ident::print()
    Item_func_nextval::print()
    Item_func_setval::print()

This change remove six my_casedn_str() calls and reduces the code size.
This commit is contained in:
Alexander Barkov
2023-08-24 14:07:46 +04:00
parent 8951f7d940
commit ee1497c068
5 changed files with 39 additions and 67 deletions

View File

@@ -1630,6 +1630,20 @@ append_identifier(THD *thd, String *packet, const char *name, size_t length)
}
/**
Similar to append_identifier(), but with optional casedn conversion.
*/
bool append_identifier_opt_casedn(THD *thd, String *to,
const LEX_CSTRING &ident, bool casedn)
{
if (!casedn)
return append_identifier(thd, to, &ident);
CharBuffer<MAX_ALIAS_NAME> buff;
LEX_CSTRING ls= buff.copy_casedn(system_charset_info, ident).to_lex_cstring();
return append_identifier(thd, to, &ls);
}
/*
Get the quote character for displaying an identifier.