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

@@character_set_collations to resolve IMPLICIT collation on JOINs

    XMLWordPrintable

Details

    Description

      If character_set_collations is for resolving implicit collation types then in can be used in a JOIN too.

      join.test

      create table t520 (t varchar(30) character set  utf8mb4 collate utf8mb4_unicode_520_ci);
      create table t1400 (t varchar(30) character set  utf8mb4 collate utf8mb4_uca1400_ai_ci);
      insert into t520 values ('bob'),('jack'), ('jane');
      insert into t1400 values ('bob'),('jack'), ('jane');
      --error ER_CANT_AGGREGATE_2COLLATIONS
      select * from t1400 join t520 on t1400.t = t520.t;
      ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_uca1400_ai_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '='
       
      SET @@character_set_collations = 'utf8mb4=uca1400_ai_ci';
      select * from t1400 join t520 on t1400.t = t520.t;
       
      ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_uca1400_ai_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '='
      

      Last case shouldn't be an error as the resolution mechanism is possible.

      recent documentation addition by greenman indicates its use "in all cases".
      https://mariadb.com/kb/en/setting-character-sets-and-collations/

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.