[MDEV-33163] Error after UPDATE..ORDER BY (window function) Created: 2024-01-03  Updated: 2024-01-03

Status: Open
Project: MariaDB Server
Component/s: Optimizer - Window functions
Affects Version/s: 10.4, 10.5, 10.6, 10.11, 11.0
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0

Type: Bug Priority: Major
Reporter: Alice Sherepa Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: not-11.1+


 Description   

There is an error on 10.4-11.0, while it is accepted on 11.1-11.3. Also error says that window function is allowed in ORDER BY, while here it is inside the ORDER BY clause.

10.4-11.0

MariaDB [test]> CREATE TABLE t ( a int, b int );
Query OK, 0 rows affected (0,052 sec)
 
MariaDB [test]> UPDATE t SET a=1 ORDER BY count(b) over ();
ERROR 4015 (HY000): Window function is allowed only in SELECT list and ORDER BY clause

11.1-11.4:

MariaDB [test]> CREATE TABLE t ( a int, b int );
Query OK, 0 rows affected (0,042 sec)
 
MariaDB [test]> UPDATE t SET a=1 ORDER BY count(b) over ();
Query OK, 0 rows affected (0,001 sec)
Rows matched: 0  Changed: 0  Warnings: 0


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