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

cp1250_czech_cs incorrect results

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5(EOL), 10.6, 10.11, 11.4, 11.8
    • 10.11, 11.4, 11.8
    • None
    • None

    Description

      Test case:

      set names cp1250;
      create table t1 (a varchar(4000) charset cp1250 collate cp1250_czech_cs);
      show create table t1;
      insert into t1 values ('a'), ('a '), ('a\t');
      select group_concat(hex(a) separator ',') from t1 group by a;
      select hex(t1.a), strcmp(t1.a,t2.a), hex(t2.a) from t1, t1 t2 where t1.a<t2.a;
      drop table t1;
      

      Result

      select group_concat(hex(a) separator ',') from t1 group by a;
      group_concat(hex(a) separator ',')
      61
      6109
      6120
      select hex(t1.a), strcmp(t1.a,t2.a), hex(t2.a) from t1, t1 t2 where t1.a<t2.a;
      hex(t1.a)       strcmp(t1.a,t2.a)      hex(t2.a)
      61      -1      6109
      6120    -1      6109
      

      First select shows that all three strings are different. Second shows that a is equal to a<space> and both are smaller than a<tab>. This is inconsistent. And this differs from other collations, for example, same test but with cp1250_general_ci shows

      select group_concat(hex(a) separator ',') from t1 group by a;
      group_concat(hex(a) separator ',')
      6109
      61,6120
      select hex(t1.a), strcmp(t1.a,t2.a), hex(t2.a) from t1, t1 t2 where t1.a<t2.a;
      hex(t1.a)       strcmp(t1.a,t2.a)      hex(t2.a)
      6109    -1      61
      6109    -1      6120
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.