[MDEV-19271] CHARSET(column) returns different result with and without ROLLUP Created: 2019-04-17  Updated: 2020-05-30

Status: Open
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.5

Type: Bug Priority: Minor
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-17830 Server crashes in Item_null_result::f... Closed

 Description   

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (d DATE) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('2018-12-12');
SELECT d, CHARSET(d) AS f FROM t1 GROUP BY d;
SELECT d, CHARSET(d) AS f FROM t1 GROUP BY d WITH ROLLUP;

The first query returns:

+------------+--------+
| d          | f      |
+------------+--------+
| 2018-12-12 | binary |
+------------+--------+

The second query returns:

+------------+--------+
| d          | f      |
+------------+--------+
| 2018-12-12 | latin1 |
| NULL       | binary |
+------------+--------+

Looks wrong. Expect equal values in the column "f" in all queries.


Generated at Thu Feb 08 08:50:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.