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

#mysql50# prefix written in upper case is accepted in default old_mode with lower_case_table_names=1

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 13.2
    • 13.2
    • Parser
    • None

    Description

      check_mysql50_prefix() compares the prefix case-sensitively and the new check runs in the parser, before the name is lowercased. With lower_case_table_names=1 a name written as #MYSQL50#... passes the check and is then treated as a legacy name. Tables and databases are both affected.

      --lower-case-table-names=1

      let $D= `select @@datadir`;
      create table `t-1` (a int) engine=myisam;
      flush tables;
      --move_file $D/test/t@002d1.frm $D/test/t-1.frm
      --move_file $D/test/t@002d1.MYD $D/test/t-1.MYD
      --move_file $D/test/t@002d1.MYI $D/test/t-1.MYI
      --mkdir $D/d-b
      select @@old_mode;
      --error ER_WRONG_TABLE_NAME
      select * from `#mysql50#t-1`;
      --echo # BUG if the statements below succeed
      select * from `#MYSQL50#t-1`;
      insert `#MYSQL50#t-1` values (1);
      use `#MYSQL50#d-b`;
      select database();
      create table `#MYSQL50#d-b`.t1 (a int);
      alter database `#MYSQL50#d-b` upgrade data directory name;
      show databases like 'd-b';
      drop database `d-b`;
      set old_mode=MYSQL50_TABLE_NAMES;
      drop table test.`#mysql50#t-1`;

      13.2.0-MariaDB-asan-debug-log source revision: bd4d5680ca4e7d8fd3b953e9f9d342599ac5c07c
       
      select * from `#MYSQL50#t-1`;
      a
      use `#MYSQL50#d-b`;
      select database();
      database()
      #mysql50#d-b

      UPDATE, CHECK TABLE, RENAME TABLE, CREATE PROCEDURE and GRANT ... ON #MYSQL50#d-b.* are accepted the same way.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0.25d
                  0.25d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                  Git Integration

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