[MDEV-31948] Add class DBNameBuffer, split check_db_name() into stages Created: 2023-08-18  Updated: 2023-09-17  Resolved: 2023-08-21

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

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

Issue Links:
Blocks
blocks MDEV-31531 Remove my_casedn_str() and my_caseup_... In Testing
blocks MDEV-31606 Refactor check_db_name() to get a con... Closed
Problem/Incident
causes MDEV-32026 lowercase_table2.test failures in 11.3 Closed

 Description   

Under terms of MDEV-31606 we'll split check_db_name() in two separate stages:

  • On the first stage, the database name will be converted to lower case if lowercase-table-table says so.
  • On the second stage, the database name will actually be validated.

The lower-cased database name is currently created:

  • either on THD::mem_root (in many cases)
  • or in a fixed size stack buffer (in rare cases, see show_create_db() as an example).

Under terms of this task we'll do the following

  • Add a new class Lex_ident_fs, to store identifiers for database objects stored on disk whose case sensitivity depend on lower-case-table-name.
  • Extract the validation code from check_db_name() to Lex_ident_fs::check_db_name(). This method will get a constant argument with the database name.
  • Add a new class DBNameBuffer to store an optionally lower-cased database name in a stack variable
  • Replace check_db_name() in show_create_db(), as well as in other places where it is suitable to use a temporary stack variable, to DBNameBuffer instantiation followed by a Lex_ident_fs::check_db_name() call.

Note, the code which creates a lower-cases database name on THD::mem_root will be modified later, under terms of MDEV-31606.


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