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

SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3.12, 5.5.37, 10.0.10
    • Fix Version/s: 5.5.38, 10.0.12, 5.3.13
    • Component/s: None
    • Labels:
      None

      Description

      SELECT
        SUBSTRING_INDEX(_utf8'.wwwmysqlcom', _utf8'.', -2) AS c1,
        SUBSTRING_INDEX(_latin1'.wwwmysqlcom',_latin1'.', -2) AS c2;

      returns

      +--------------+----+
      | c1           | c2 |
      +--------------+----+
      | .wwwmysqlcom |    |
      +--------------+----+

      c1 is correct, c2 is wrong.

      MySQL-5.5 has the same problems.
      MySQL-5.6 and 5.7 work fine.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: