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

Unexpected question mark in the end of a TINYTEXT column

Details

    Description

      The problem is repeatable with all versions from 10.2 to 10.7.

      CREATE OR REPLACE TABLE t1 (a TINYTEXT character set utf8) engine=myisam default charset=utf8;
      INSERT IGNORE INTO t1 VALUES (REPEAT(_utf8 0xD184, 250));
      SELECT LENGTH(a), CHAR_LENGTH(a), RIGHT(a,3) FROM t1;
      

      +-----------+----------------+------------+
      | LENGTH(a) | CHAR_LENGTH(a) | RIGHT(a,3) |
      +-----------+----------------+------------+
      |       255 |            128 | фф?        |
      +-----------+----------------+------------+
      

      Looks wrong. There should not be ? at the end. The expected result is:

      +-----------+----------------+------------+
      | LENGTH(a) | CHAR_LENGTH(a) | RIGHT(a,3) |
      +-----------+----------------+------------+
      |       254 |            127 | ффф        |
      +-----------+----------------+------------+
      

      Attachments

        Activity

          bar Alexander Barkov created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Fix Version/s 10.2 [ 14601 ]
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Affects Version/s 10.2 [ 14601 ]
          Affects Version/s 10.3 [ 22126 ]
          Affects Version/s 10.4 [ 22408 ]
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          bar Alexander Barkov made changes -
          Assignee Alexander Barkov [ bar ]
          bar Alexander Barkov made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]
          bar Alexander Barkov made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]
          bar Alexander Barkov made changes -
          Description Tested with 10.5. But the problem is probably repeatable with earlier versions.
          {code:sql}
          CREATE OR REPLACE TABLE t1 (a TINYTEXT character set utf8) engine=myisam default charset=utf8;
          INSERT IGNORE INTO t1 VALUES (REPEAT(_utf8 0xD184, 250));
          SELECT LENGTH(a), CHAR_LENGTH(a), RIGHT(a,3) FROM t1;
          {code}
          {noformat}
          +-----------+----------------+------------+
          | LENGTH(a) | CHAR_LENGTH(a) | RIGHT(a,3) |
          +-----------+----------------+------------+
          | 255 | 128 | фф? |
          +-----------+----------------+------------+
          {noformat}
          Looks wrong. There should not be ? at the end. The expected result is:

          {noformat}
          +-----------+----------------+------------+
          | LENGTH(a) | CHAR_LENGTH(a) | RIGHT(a,3) |
          +-----------+----------------+------------+
          | 254 | 127 | ффф |
          +-----------+----------------+------------+
          {noformat}
          The problem is repeatable with all versions from 10.2 to 10.7.
          {code:sql}
          CREATE OR REPLACE TABLE t1 (a TINYTEXT character set utf8) engine=myisam default charset=utf8;
          INSERT IGNORE INTO t1 VALUES (REPEAT(_utf8 0xD184, 250));
          SELECT LENGTH(a), CHAR_LENGTH(a), RIGHT(a,3) FROM t1;
          {code}
          {noformat}
          +-----------+----------------+------------+
          | LENGTH(a) | CHAR_LENGTH(a) | RIGHT(a,3) |
          +-----------+----------------+------------+
          | 255 | 128 | фф? |
          +-----------+----------------+------------+
          {noformat}
          Looks wrong. There should not be ? at the end. The expected result is:

          {noformat}
          +-----------+----------------+------------+
          | LENGTH(a) | CHAR_LENGTH(a) | RIGHT(a,3) |
          +-----------+----------------+------------+
          | 254 | 127 | ффф |
          +-----------+----------------+------------+
          {noformat}
          bar Alexander Barkov made changes -
          issue.field.resolutiondate 2021-11-02 05:24:19.0 2021-11-02 05:24:19.849
          bar Alexander Barkov made changes -
          Fix Version/s 10.2.41 [ 26032 ]
          Fix Version/s 10.3.32 [ 26029 ]
          Fix Version/s 10.4.22 [ 26031 ]
          Fix Version/s 10.5.13 [ 26026 ]
          Fix Version/s 10.6.5 [ 26034 ]
          Fix Version/s 10.7.1 [ 26120 ]
          Fix Version/s 10.2 [ 14601 ]
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          dbart Daniel Bartholomew made changes -
          Fix Version/s 10.2.42 [ 26803 ]
          Fix Version/s 10.3.33 [ 26805 ]
          Fix Version/s 10.4.23 [ 26807 ]
          Fix Version/s 10.5.14 [ 26809 ]
          Fix Version/s 10.6.6 [ 26811 ]
          Fix Version/s 10.7.2 [ 26813 ]
          Fix Version/s 10.5.13 [ 26026 ]
          Fix Version/s 10.3.32 [ 26029 ]
          Fix Version/s 10.4.22 [ 26031 ]
          Fix Version/s 10.2.41 [ 26032 ]
          Fix Version/s 10.6.5 [ 26034 ]
          Fix Version/s 10.7.1 [ 26120 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 116415 ] MariaDB v4 [ 158647 ]

          People

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