Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.3
-
None
-
None
-
2018-05, 2018-06
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) |