Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-2233

SUBSTRING_INDEX() returns incorrect value when index value is negative

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 1.2.3
    • 1.2.3
    • ExeMgr
    • None
    • 2019-03

    Description

      Build tested: 1.2.3-1

      MariaDB [mytest]> create table t3 (c char(10)) engine=columnstore;
      Query OK, 0 rows affected (0.169 sec)

      MariaDB [mytest]> insert into t3 values ('aaaaaaaaaa');
      Query OK, 1 row affected (0.165 sec)

      MariaDB [mytest]> select c, SUBSTRING_INDEX(c,'a', -3) from t3;
      --------------------------------------+

      c SUBSTRING_INDEX(c,'a', -3)

      --------------------------------------+

      aaaaaaaaaa aaaaaaaaaa

      --------------------------------------+
      1 row in set (0.061 sec)

      The query should return 'aa' instead.

      Attachments

        Issue Links

          Activity

            People

              dleeyh Daniel Lee (Inactive)
              dleeyh Daniel Lee (Inactive)
              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.