[MDEV-27143] Different result when group by with correct function Created: 2021-11-30  Updated: 2022-01-14

Status: Open
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Marco Zhang Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Linux


Attachments: PNG File group by withoutconvert. png.png     PNG File 图片3.png    
Issue Links:
Blocks
blocks MDEV-26853 Confusing row numbers upon ER_TRUNCAT... Open

 Description   

create table t (c int);
insert into t values (20121212),(9),(19800101),(20121212),(19800101);
 
select c, count(*) from t group by  c desc with rollup; 
 
MariaDB [test]> select c, count(*) from t group by c desc with rollup; 
+----------+----------+
| c              | count(*) |
+----------+----------+
| 20121212 |        2 |
| 19800101 |        2 |
|        9           |        1 |
|     NULL     |        5 |
+----------+----------+
4 rows in set (0.001 sec)
 
select c, count(*) from t group by convert(c, int) desc with rollup; 
MariaDB [test]> select c, count(*) from t group by convert(c,int) desc with rollup; 
+----------+----------+
| c              | count(*) |
+----------+----------+
| 20121212 |        2 |
| 19800101 |        2 |
|        9           |        1 |
|        9           |        5 |
+----------+----------+

When the group by with rollup in correct function ,there will be have different results.


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