mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
MDEV-10773: ANALYZE FORMAT=JSON query_with_CTE crashes
Added testcase
This commit is contained in:
parent
6a65de6cda
commit
45f11a729c
2 changed files with 77 additions and 0 deletions
|
@ -2343,3 +2343,68 @@ select id + 1, uuid() from data_generator where id < 150000
|
|||
select * from data_generator
|
||||
) as a;
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-10773: ANALYZE FORMAT=JSON query_with_CTE crashes
|
||||
#
|
||||
analyze format=json
|
||||
with recursive src(counter) as
|
||||
(select 1
|
||||
union
|
||||
select counter+1 from src where counter<10
|
||||
) select * from src;
|
||||
ANALYZE
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"table": {
|
||||
"table_name": "<derived2>",
|
||||
"access_type": "ALL",
|
||||
"r_loops": 1,
|
||||
"rows": 2,
|
||||
"r_rows": 10,
|
||||
"r_total_time_ms": "REPLACED"e-4,
|
||||
"filtered": 100,
|
||||
"r_filtered": 100,
|
||||
"materialized": {
|
||||
"query_block": {
|
||||
"recursive_union": {
|
||||
"table_name": "<union2,3>",
|
||||
"access_type": "ALL",
|
||||
"r_loops": 0,
|
||||
"r_rows": null,
|
||||
"query_specifications": [
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 2,
|
||||
"table": {
|
||||
"message": "No tables used"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 3,
|
||||
"r_loops": 10,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"table": {
|
||||
"table_name": "<derived2>",
|
||||
"access_type": "ALL",
|
||||
"r_loops": 10,
|
||||
"rows": 2,
|
||||
"r_rows": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
"r_filtered": 90,
|
||||
"attached_condition": "src.counter < 10"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1505,3 +1505,15 @@ select id, test_data
|
|||
) as a;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-10773: ANALYZE FORMAT=JSON query_with_CTE crashes
|
||||
--echo #
|
||||
--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
|
||||
analyze format=json
|
||||
with recursive src(counter) as
|
||||
(select 1
|
||||
union
|
||||
select counter+1 from src where counter<10
|
||||
) select * from src;
|
||||
|
||||
|
|
Loading…
Reference in a new issue