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

Add class DBNameBuffer, split check_db_name() into stages

    XMLWordPrintable

Details

    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.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.