[MDEV-31991] Split class Database_qualified_name Created: 2023-08-23  Updated: 2023-12-27  Resolved: 2023-08-23

Status: Closed
Project: MariaDB Server
Component/s: Character Sets, Stored routines
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-31531 Remove my_casedn_str() and my_caseup_... In Testing
blocks MDEV-31606 Refactor check_db_name() to get a con... Closed

 Description   

Class Database_qualified_name is currently used for two purposes when handling package routines such as `db.pkg.func`:

  • to store the `db.pkg` pair
  • to store the `pkg.func` pair

The data type of Database_qualified_name::m_name will be changed from LEX_CSTRING to Lex_ident_db soon, so it will contain a validated and normalized database name, which means lower-cased if lower-case-table-names says so.

Therefore, Database_qualified_name won't be able to store `pkg.func` pairs any more - the `pkg` part must not depend on lower-case-table-names.

Let's add a new class Identifier_chain2 and move the following methods from Database_qualified_name to Identifier_chain2, as follows:

class Identifier_chain2
{
  LEX_CSTRING m_name[2];
public:
  Identifier_chain2(const LEX_CSTRING &a, const LEX_CSTRING &b)
   :m_name{a, b}
  { }
 
  // These methods were in Database_qualified_name originally:
 
  static Identifier_chain2 split(const LEX_CSTRING &txt);
 
  size_t make_qname(char *dst, size_t dstlen) const;
 
  bool make_qname(MEM_ROOT *mem_root, LEX_CSTRING *dst) const;
};

Also, let's change the data type of the following variables from Database_qualified_name to Identifier_chain2:

  • q_pkg_proc in LEX::call_statement_start()
  • q_pkg_func in LEX::make_item_func_call_generic()

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