[MDEV-15870] Using aggregate and window function in unexpected places can crash the server Created: 2018-04-15  Updated: 2018-06-13  Resolved: 2018-06-13

Status: Closed
Project: MariaDB Server
Component/s: Stored routines
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.2.16, 10.3.8

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-11953 support of brackets (parentheses) in ... Closed
relates to MDEV-15057 Crash when using an unknown identifie... Closed
relates to MDEV-15328 MariaDB 10.2.13 Crashes upon CALL PRO... Closed

 Description   

These examples crash the server:

CREATE OR REPLACE PROCEDURE p1 (a TEXT) BEGIN END;
CALL p1(RANK() OVER (ORDER BY 1));

CREATE OR REPLACE PROCEDURE p1 (a TEXT) BEGIN END;
CALL p1(ROW_NUMBER() OVER ());

CREATE OR REPLACE PROCEDURE p1 (a TEXT) BEGIN END;
CALL p1(SUM(1));



 Comments   
Comment by Alexander Barkov [ 2018-04-16 ]

In 10.1 it works fine:

MariaDB [test]> CALL p1(SUM(1));
ERROR 1111 (HY000): Invalid use of group function

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