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

Wrong collation for new table when all defaults set.

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • N/A
    • Documentation
    • Linux and Windows

    Description

      If the database collation is 'utf8mb4_unicode_520_ci', I expect new tables with character set utf8mb4 will have that same collation. However, the new table created has collation 'utf8mb4_general_ci';

       
      SET collation_connection = 'utf8mb4_unicode_520_ci';
      SET NAMES 'utf8mb4' COLLATE 'utf8mb4_unicode_520_ci';
      SET CHARACTER SET 'utf8mb4';
      CREATE DATABASE test CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_520_ci';
       
      CREATE TABLE `test`.`tester` (
        `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
        `name` varchar(191) NOT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
       
      select TABLE_COLLATION from tables where TABLE_SCHEMA = 'test' AND TABLE_NAME = 'tester';
       
      +--------------------+
      | TABLE_COLLATION    |
      +--------------------+
      | utf8mb4_general_ci |
      +--------------------+
      
      

      why?

      Attachments

        Activity

          People

            JoeCotellese Joe Cotellese
            fforte Frank Forte
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.