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

Remove old check_db_name() from make_table_name_list()

    XMLWordPrintable

Details

    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);
        ...
      };
      

      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.