[MCOL-4872] HEX hybrid is treated as a number in string context Created: 2021-09-22  Updated: 2024-01-16

Status: Open
Project: MariaDB ColumnStore
Component/s: PrimProc
Affects Version/s: 5.6.2
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Leonid Fedorov
Resolution: Unresolved Votes: 0
Labels: beginner-friendly

Issue Links:
Relates
relates to MCOL-4871 Extent elimination for short CHAR doe... Closed

 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.



 Comments   
Comment by Subhasish Behera [ 2024-01-02 ]

I would like to work on this issue as my first issue. is it available to work on?

Comment by Roman [ 2024-01-16 ]

Hi Subhasish Behera.
Thanks for the initiative.
I suggest you to contact me in zulip first.

Generated at Thu Feb 08 02:53:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.