[MDEV-31986] Remove old check_db_name() from make_table_name_list() Created: 2023-08-23  Updated: 2023-09-17  Resolved: 2023-08-23

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   

Let's replace the old style inplace check_db_name() in make_table_name_list():

  if (check_db_name((LEX_STRING*)db_name))
     return 0; // Impossible TABLE_SCHEMA name

to the new style (non-modifying) code:

  DBNameBuffer dbbuf(*db_name, lower_case_table_names);
  const Lex_ident_db dbnorm= dbbuf.to_lex_ident_db();
  if (!dbnorm.str)
     return 0; // Impossible TABLE_SCHEMA name

Additionally, as agreed with Serg, let's add the "const" qualifier to the "db" parameter to functions ha_discover_table_names() and handlerton::discover_table_names() to make them look as follows:

int ha_discover_table_names(THD *thd, const LEX_CSTRING *db, MY_DIR *dirp,
                            Discovered_table_list *result, bool reusable);

struct handlerton
{
  ...
  int (*discover_table_names)(handlerton *hton, const LEX_CSTRING *db,
                              MY_DIR *dir,
                              discovered_list *result);
  ...
};


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