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

Character comparison incorect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Confirmed (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5, 10.1, 10.2, 10.3, 10.4, 10.4.11
    • Fix Version/s: 10.1, 10.2, 10.3, 10.4
    • Component/s: Character Sets
    • Labels:
    • Environment:
      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

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            eimix Eimantas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: