[MDEV-32002] Remove my_casedn_str() in append_identifier() context Created: 2023-08-24  Updated: 2023-09-12  Resolved: 2023-08-24

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Fix Version/s: 11.3.0

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-27490 Allow full utf8mb4 for identifiers Stalled
blocks MDEV-31531 Remove my_casedn_str() and my_caseup_... In Testing
blocks MDEV-31606 Refactor check_db_name() to get a con... Closed

 Description   

Under terms of MDEV-27490 we'll swith to Unicode-14.0.0. In this Unicode version a string can grow during a casedb conversion. We need to remove all my_casedn_str() calls done for identifiers.

Under tems of this task, let's remove my_casedn_str() whose results are further passed to append_identifier().

Let's add this helper function:

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);
}

and reuse it in:

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

This change is also expected to reduce the code size.


Generated at Thu Feb 08 10:28:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.