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

Refactor check_db_name() to get a const argument

    XMLWordPrintable

Details

    Description

      This task was originally a part of MDEV-31531, but now is a separate task, because it'll be quite a big change itself.

      check_db_name() converts the argument to lower case if lower_case_table_name>0.
      It uses my_casedn_str(), which converts the data to lower case in-place. As far as in-place conversion won't be possible after we switch to Unicode-14 casefolding rules (because conversion to lower case can increase the string length in Unicode-14), we need to refactor all uses of check_db_name() not to use in-place casefolding conversion.

      The current implementation of:

      bool check_db_name(LEX_STRING *db);
      

      should be changed to get a constant argument:

      bool check_db_name(const LEX_CSTRING &db);
      

      All old-style check_db_name() use cases should be changed in the way that in case of lower_case_table_names>1 the following sequence is done:

      • Convert an existing database name to a new database name in lower case into a NEW memory location.
      • Call the NEW version of check_db_name() on the NEW memory location.

      Attachments

        Issue Links

          Activity

            People

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