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

Table names have wrong case when created with LIKE

    XMLWordPrintable

Details

    Description

      I have "lower_case_table_names=2" in my.ini. When I create a table and specify its columns, the table is created with my requested capitalization. But when I create a table using "LIKE", the table is created an all lowercase name. In both cases, the columns have the correct case.

      Run this script:

      CREATE TABLE TestTableA (`ID` INT PRIMARY KEY,`Name` VARCHAR(255));
      CREATE TABLE TestTableB LIKE TestTableA;
      SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME LIKE 'TestTable%';
      DESCRIBE TestTableA;
      DESCRIBE TestTableB;
      

      The result says:

      +------------+
      | TABLE_NAME |
      +------------+
      | TestTableA |
      | testtableb |
      +------------+
      

      +-------+--------------+------+-----+---------+-------+
      | Field | Type         | Null | Key | Default | Extra |
      +-------+--------------+------+-----+---------+-------+
      | ID    | int(11)      | NO   | PRI | NULL    |       |
      | Name  | varchar(255) | YES  |     | NULL    |       |
      +-------+--------------+------+-----+---------+-------+
      

      +-------+--------------+------+-----+---------+-------+
      | Field | Type         | Null | Key | Default | Extra |
      +-------+--------------+------+-----+---------+-------+
      | ID    | int(11)      | NO   | PRI | NULL    |       |
      | Name  | varchar(255) | YES  |     | NULL    |       |
      +-------+--------------+------+-----+---------+-------+
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            bugmenot June Wallace
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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