1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00
Files
mariadb-columnstore-engine/mysql-test/columnstore/bugfixes/MCOL-5755-incorrect-group-by-handling-of-BLOB.test
Serguey Zefirov 3bb2496ca1 fix: MCOL-5755: incorrect handling of BLOB (and TEXT) in GROUP BY
BLOB fields did not work as grouping keys at all, they were assigned
value NULL for any value, be it NULL or not. The fix is in the
rowaggregation.cpp in the initMapping(), a switch/case branch was added
to handle BLOB field copying there.

Also, TEXT columns did not distinguish between NULL and empty string in
the grouping algorithm, now they do. The fix is in the equals()
function, now we specifically check for isNull() equality between
values.
2025-05-23 05:12:17 +04:00

19 lines
588 B
Plaintext

--disable_warnings
DROP DATABASE IF EXISTS MCOL5755;
--enable_warnings
CREATE DATABASE MCOL5755;
USE MCOL5755;
CREATE TABLE t1 (t TEXT,c CHAR(10),b BLOB) ENGINE = columnstore;
INSERT INTO t1 VALUES (NULL,NULL,NULL);
INSERT INTO t1 VALUES ("","","");
INSERT INTO t1 VALUES ("hello","hello","hello");
INSERT INTO t1 VALUES ("HELLO","HELLO","HELLO");
INSERT INTO t1 VALUES ("HELLO MY","HELLO MY","HELLO MY");
INSERT INTO t1 VALUES ("a","a","a");
INSERT INTO t1 VALUES (1,1,1);
--sorted_result
SELECT b FROM t1 GROUP BY b;
--sorted_result
SELECT t FROM t1 GROUP BY t;
DROP DATABASE MCOL5755;