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

Unexpected error on ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb3, DEFAULT CHARACTER SET utf8mb4

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
    • Fix Version/s: 10.9.2
    • Component/s: Character Sets
    • Labels:
      None

      Description

      It's impossible to convert a table to some character set, but at the same time set the DEFAULT character set to another character set:

      ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb3, DEFAULT CHARACTER SET utf8mb4;
      

      ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET utf8mb3' and 'CHARACTER SET utf8mb4'
      

      The problem happens because the code handling both clauses uses HA_CREATE_INFO::default_table_charset to check conflicting declarations.

      The test for conflicts was added by MDEV-7387. Before MDEV-7387 it worked even worse:

      ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1;
      

      ignored the utf8 part and just use the latin1 part for both conversion and DEFAULT.

      It should be fixed to allow any combinations of cs1/cl1 and cs2/cs2 in:

      • [DEFAULT] CHARACTER SET cs1 [COLLATE cl1], and
      • CONVERT TO CHARACTER SET cs2 [COLLATE cs2]

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              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.