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

Inconsistency of json fields character sets

    XMLWordPrintable

Details

    Description

      In CREATE TABLE JSON fields default to utf8mb4, even if not specified, resulting in its overriding the charset of the table. However, the overriding does not happen in ALTER TABLE when the table charset is changed, resulting in the inconsistency shown below:

      CREATE TABLE t ( cj JSON ) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;
      select character_set_name from information_schema.columns where table_name = 't' and column_name='cj';
      character_set_name
      utf8mb4
      alter table t CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;
      select character_set_name from information_schema.columns where table_name = 't' and column_name='cj';
      character_set_name
      utf8mb3
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              ycp Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.