Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.6.2
Description
I run the following SQL script with a MyISAM table:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a CHAR(4)) ENGINE=MyISAM; |
INSERT INTO t1 VALUES ('122'),('z'); |
SELECT CONCAT(a, 0x7A) FROM t1; |
SELECT * FROM t1 WHERE a=0x7A; |
It returns these results:
+-----------------+
|
| CONCAT(a, 0x7A) |
|
+-----------------+
|
| 122z |
|
| zz |
|
+-----------------+
|
+------+
|
| a |
|
+------+
|
| z |
|
+------+
|
Now I repeat the same script with ColumnStore:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a CHAR(10)) ENGINE=ColumnStore; |
INSERT INTO t1 VALUES ('122'),('z'); |
SELECT CONCAT(a, 0x7A) FROM t1; |
SELECT * FROM t1 WHERE a=0x7A; |
It returns different results:
+-----------------+
|
| CONCAT(a, 0x7A) |
|
+-----------------+
|
| 122122 |
|
| z122 |
|
+-----------------+
|
+------+
|
| a |
|
+------+
|
| 122 |
|
+------+
|
It seems a hex hybrid is always treated as a number in ColumnStore.
It should be fixed to behave like in MariaDB:
- as a character string in string context
- as a number in numeric context
The same problem is repeatable with VARCHAR and TEXT instead of CHAR.
Attachments
Issue Links
- relates to
-
MCOL-4871 Extent elimination for short CHAR does not work well
- Closed