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

Character comparison incorect

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.11, 5.5(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.4(EOL)
    • Character Sets
    • debian buster + mariadb-10.4.11-linux-systemd-x86_64

    Description

      Standard symbols comparison is not working as expected if using latin7 connection.

      't' is not LIKE 'T' in latin7,
      but is correct in latin1 or utf8.

      Expected same comparison in all charsets, but it is different.

      SQL:

      set names latin1;
      select 'T' = 't', 't' = 'T', 't' LIKE 'T', upper('t'), LOWER('T'), UPPER('t') = 'T';
      +-----------+-----------+--------------+------------+------------+------------------+
      | 'T' = 't' | 't' = 'T' | 't' LIKE 'T' | upper('t') | LOWER('T') | UPPER('t') = 'T' |
      +-----------+-----------+--------------+------------+------------+------------------+
      |         1 |         1 |            1 | T          | t          |                1 |
      +-----------+-----------+--------------+------------+------------+------------------+
       
      set names latin7;
      select 'T' = 't', 't' = 'T', 't' LIKE 'T', upper('t'), LOWER('T'), UPPER('t') = 'T';
      +-----------+-----------+--------------+------------+------------+------------------+
      | 'T' = 't' | 't' = 'T' | 't' LIKE 'T' | upper('t') | LOWER('T') | UPPER('t') = 'T' |
      +-----------+-----------+--------------+------------+------------+------------------+
      |         0 |         0 |            0 | T          | t          |                1 |
      +-----------+-----------+--------------+------------+------------+------------------+
       
      set names utf8;
      select 'T' = 't', 't' = 'T', 't' LIKE 'T', upper('t'), LOWER('T'), UPPER('t') = 'T';
      +-----------+-----------+--------------+------------+------------+------------------+
      | 'T' = 't' | 't' = 'T' | 't' LIKE 'T' | upper('t') | LOWER('T') | UPPER('t') = 'T' |
      +-----------+-----------+--------------+------------+------------+------------------+
      |         1 |         1 |            1 | T          | t          |                1 |
      +-----------+-----------+--------------+------------+------------+------------------+
      

      MySQL same type of bug
      https://bugs.mysql.com/bug.php?id=86622

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              eimix Eimantas
              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.