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

Optimizer Context Replay: wrong table names on MacOS

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      The problem is observed only on MacOS (where lower_case_table_names=2 AFAIU).

      It looks like this:
      https://buildbot.mariadb.org/#/builders/590/builds/29522/steps/5/logs/stdio

      main.opt_context_store_ddls              w22 [ fail ]
              Test ended at 2026-08-12 12:34:48
      CURRENT_TEST: main.opt_context_store_ddls
      --- /Users/ec2-user/buildbot/prod/aarch64-macos/build/mysql-test/main/opt_context_store_ddls.result	2026-08-12 12:12:43
      +++ /Users/ec2-user/buildbot/prod/aarch64-macos/build/mysql-test/main/opt_context_store_ddls.reject	2026-08-12 12:34:48
      @@ -254,11 +254,11 @@
       db1.t1
       # === Optimizer Context DDLs
       @ddls
      -CREATE TABLE IF NOT EXISTS `db2`.`t1` (
      +CREATE TABLE IF NOT EXISTS `db2`.`db2_t1` (
         `a` int(11) DEFAULT NULL
       ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
      

      the query is

      SELECT ... FROM db2.t1 as db2_t1
      

      so it uses an alias as a table name.

      Indeed, this is what show_create_table_ex code does:

            if (lower_case_table_names == 2)
            {
              alias.str= table->alias.c_ptr();
              alias.length= table->alias.length();
            }
            else
              alias= share->table_name;
          }
      

      We need to get the table name as it is on disk.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              psergei Sergei Petrunia
              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.