Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.4.3
Description
I create a table with a VARCHAR column using latin1_swedish_nopad_ci as a collation. I expect strings that have different number of trailing spaces to be compared as not equal. But in fact ColumnStore ignores the NOPAD collation attribute in the equality operator and compares 'a' and 'a ' as equal.
This script demonstrates the problem:
DROP TABLE IF EXISTS t5; |
CREATE TABLE t5 (a VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_nopad_ci) ENGINE=COLUMNSTORE; |
INSERT INTO t5 VALUES ('a'),('a '); |
SELECT HEX(a) FROM t5 WHERE a='a'; |
+--------+
|
| HEX(a) |
|
+--------+
|
| 61 |
|
| 6120 |
|
+--------+
|
Notice, it returned two rows. Only the row with the hex value 61 is expected.
SELECT HEX(a) FROM t5 WHERE a='a ';
|
+--------+
|
| HEX(a) |
|
+--------+
|
| 61 |
|
| 6120 |
|
+--------+
|
Notice, it returned two rows. Only the row with the hex value 6120 is expected.
Note, if I run the same script with another engine, e.g. InnoDB, it returns a correct result:
DROP TABLE IF EXISTS t5; |
CREATE TABLE t5 (a VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_nopad_ci) ENGINE=INNODB; |
INSERT INTO t5 VALUES ('a'),('a '); |
SELECT HEX(a) FROM t5 WHERE a='a'; |
+--------+
|
| HEX(a) |
|
+--------+
|
| 61 |
|
+--------+
|
SELECT HEX(a) FROM t5 WHERE a='a ';
|
+--------+
|
| HEX(a) |
|
+--------+
|
| 6120 |
|
+--------+
|
Attachments
Issue Links
- is blocked by
-
MCOL-4422 Remove mariadb.h and my_sys.h dependency from collation.h
- Closed
- relates to
-
MCOL-1246 Trailing whitespace in CHAR/VARCHAR break string matches
- Closed
-
MCOL-4064 Make JOIN collation aware
- Closed
-
MCOL-4417 Non-equality comparison operators do not work well with NOPAD collations
- Closed
-
MCOL-4498 LIKE is not collation aware
- Closed
-
MCOL-495 Make string comparison not case sensitive
- Closed
-
MCOL-4065 DISTINCT is case sensitive
- Closed
-
MCOL-4539 WHERE short_char_column='literal' ignores the collation on a huge table
- Closed