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

Trailing whitespace in CHAR/VARCHAR break string matches

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.3
    • Fix Version/s: 1.1.4
    • Component/s: None
    • Labels:
      None

      Description

      If there is a trailing space in a char/varchar column then string matches become impossible:

      MariaDB [test]> create table t1 (a int, b varchar(4)) engine=columnstore;
      Query OK, 0 rows affected (0.34 sec)
       
      MariaDB [test]> insert into t1 values (1, 'ABC ');
      Query OK, 1 row affected (0.53 sec)
       
      MariaDB [test]> select * from t1 where b = 'ABC';
      Empty set (0.16 sec)
       
      MariaDB [test]> select * from t1 where b like 'ABC';
      Empty set (0.03 sec)
       
      MariaDB [test]> select a, hex(b) from t1;
      +------+----------+
      | a    | hex(b)   |
      +------+----------+
      |    1 | 41424320 |
      +------+----------+
      1 row in set (0.03 sec)
      

      Whereas with InnoDB:

      MariaDB [test]> create table t2 (a int, b varchar(4));
      Query OK, 0 rows affected (0.03 sec)
       
      MariaDB [test]> insert into t2 values (1, 'ABC ');
      Query OK, 1 row affected (0.01 sec)
       
      MariaDB [test]> select * from t2 where b = 'ABC';
      +------+------+
      | a    | b    |
      +------+------+
      |    1 | ABC  |
      +------+------+
      1 row in set (0.00 sec)
       
      MariaDB [test]> select * from t2 where b like 'ABC';
      Empty set (0.01 sec)
       
      MariaDB [test]> select a, hex(b) from t2;
      +------+----------+
      | a    | hex(b)   |
      +------+----------+
      |    1 | 41424320 |
      +------+----------+
      1 row in set (0.00 sec)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dleeyh Daniel Lee
              Reporter:
              LinuxJedi Andrew Hutchings (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.