mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Added the test case for bug mdev-9941 that was fixed some time ago.
This commit is contained in:
parent
4872ec6177
commit
457f3b9941
2 changed files with 70 additions and 0 deletions
|
@ -2142,3 +2142,46 @@ pk a d sum_1 sum_2
|
|||
10 2 0.800 1.700 2.400
|
||||
11 2 0.900 0.900 2.800
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-9941: two window functions with compatible partitions
|
||||
#
|
||||
create table t1 (
|
||||
a int,
|
||||
b int,
|
||||
c int
|
||||
);
|
||||
insert into t1 values
|
||||
(10, 1, 1),
|
||||
(10, 3, 10),
|
||||
(10, 1, 10),
|
||||
(10, 3, 100),
|
||||
(10, 5, 1000),
|
||||
(10, 1, 100);
|
||||
explain format=json
|
||||
select
|
||||
a,b,c,
|
||||
row_number() over (partition by a),
|
||||
row_number() over (partition by a, b)
|
||||
from t1;
|
||||
EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"window_functions_computation": {
|
||||
"sorts": {
|
||||
"filesort": {
|
||||
"sort_key": "t1.a, t1.b"
|
||||
}
|
||||
},
|
||||
"temporary_table": {
|
||||
"table": {
|
||||
"table_name": "t1",
|
||||
"access_type": "ALL",
|
||||
"rows": 6,
|
||||
"filtered": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
drop table t1;
|
||||
|
|
|
@ -1310,3 +1310,30 @@ select pk, a, d,
|
|||
from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-9941: two window functions with compatible partitions
|
||||
--echo #
|
||||
|
||||
create table t1 (
|
||||
a int,
|
||||
b int,
|
||||
c int
|
||||
);
|
||||
|
||||
insert into t1 values
|
||||
(10, 1, 1),
|
||||
(10, 3, 10),
|
||||
(10, 1, 10),
|
||||
(10, 3, 100),
|
||||
(10, 5, 1000),
|
||||
(10, 1, 100);
|
||||
|
||||
explain format=json
|
||||
select
|
||||
a,b,c,
|
||||
row_number() over (partition by a),
|
||||
row_number() over (partition by a, b)
|
||||
from t1;
|
||||
|
||||
drop table t1;
|
||||
|
|
Loading…
Reference in a new issue