[MDEV-28524] incorrect result for window function with group by and rollup Created: 2022-05-10  Updated: 2023-04-27

Status: Confirmed
Project: MariaDB Server
Component/s: Optimizer, Optimizer - Window functions
Affects Version/s: 10.5, 10.6
Fix Version/s: 10.5, 10.6

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: None


 Description   

visible on a test case for MDEV-19398:

CREATE TABLE t1 ( a char(25), b text);
INSERT INTO t1 VALUES ('foo','bar');
 
SELECT
  SUM(b)       OVER (PARTITION BY a),
  ROW_NUMBER() OVER (PARTITION BY b)
FROM t1
GROUP BY
  LEFT((SYSDATE()), 'foo')
WITH ROLLUP;

10.6 with MyISAM shows correct result, 10.6/InnoDB and 10.5 show incorrect result



 Comments   
Comment by Sergei Petrunia [ 2022-05-17 ]

Initial investigation: https://gist.github.com/spetrunia/2d516a6c4b05de62198f0cba18ce2e1d

Generated at Thu Feb 08 10:01:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.