Commit 2905b2fe authored by Sergei Petrunia's avatar Sergei Petrunia

Window functions: return error if aggregate is not supported as window functions

parent 29705a4d
......@@ -1831,3 +1831,13 @@ rank() over (order by b)
0
0
drop table t1;
#
# MDEV-9894: Assertion `0' failed in Window_func_runner::setup
# return ER_NOT_SUPPORTED_YET for aggregates that are not yet supported
# as window functions.
#
create table t1 (i int);
insert into t1 values (1),(2);
SELECT MAX(i) OVER (PARTITION BY (i)) FROM t1;
ERROR 42000: This version of MariaDB doesn't yet support 'This aggregate as window function'
drop table t1;
......@@ -1113,3 +1113,14 @@ from
drop table t1;
--echo #
--echo # MDEV-9894: Assertion `0' failed in Window_func_runner::setup
--echo # return ER_NOT_SUPPORTED_YET for aggregates that are not yet supported
--echo # as window functions.
--echo #
create table t1 (i int);
insert into t1 values (1),(2);
--error ER_NOT_SUPPORTED_YET
SELECT MAX(i) OVER (PARTITION BY (i)) FROM t1;
drop table t1;
......@@ -1766,7 +1766,8 @@ bool Window_func_runner::setup(THD *thd)
break;
}
default:
DBUG_ASSERT(0);
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "This aggregate as window function");
return true;
}
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment