Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-31991

Split class Database_qualified_name

    XMLWordPrintable

Details

    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()

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.