[MDEV-9958] Server hangs if OVER() is empty Created: 2016-04-20  Updated: 2016-10-04  Resolved: 2016-10-04

Status: Closed
Project: MariaDB Server
Component/s: Optimizer - Window functions
Affects Version/s: 10.2
Fix Version/s: 10.2.2

Type: Bug Priority: Critical
Reporter: Federico Razzoli Assignee: Vicențiu Ciorbaru
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-10184 Query with ROW_NUMBER() hangs indefin... Closed

 Description   

Empty OVER() clause is supported in PostgreSQL (no PARTITION BY or ORDER BY between parenthesis). I don't know if MariaDB is going to support it. However, if it doesn't, I'd expect an error message. Instead, the server simply hangs. No query is being executed, but the client freezes without showing any results or errors.

CREATE OR REPLACE TABLE t
(
         num INT UNSIGNED NOT NULL
)
         ENGINE InnoDB
;
 
INSERT INTO t VALUES (1), (2), (3);
 
SELECT
num, SUM(num) OVER () AS sum_salary
FROM t;



 Comments   
Comment by Elena Stepanova [ 2016-04-20 ]

Also reported by by Peter in his blog.

Most likely it's a non-debug variation of the debug assertion reported here: MDEV-9935.
Assigning to psergey to check that the hang is gone after the assertion failure is fixed.

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