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

Trailing whitespace in CHAR/VARCHAR break string matches

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.3
    • 1.1.4
    • None
    • 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

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