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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.3.12, 5.5.37, 10.0.10
    • 5.5.38, 10.0.12, 5.3.13
    • None
    • 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

            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.