1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-11274: Executing EXPLAIN of complex query over join limit causes server to crash

For this case we have a view that is mergeable but we are not able to merge it in the
parent select because that would exceed the maximum tables allowed in the join list, so we
materialise this view
TABLE_LIST::dervied is NULL for such views, it is only set for views which have ALGORITHM=TEMPTABLE
Fixed by making sure TABLE_LIST::derived is set for views that could not be merged
This commit is contained in:
Varun Gupta
2018-03-24 03:31:18 +05:30
parent e8c2366bf8
commit bdab8b74ff
3 changed files with 394 additions and 0 deletions

View File

@@ -2125,6 +2125,7 @@ struct TABLE_LIST
DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
(alias ? alias : "<NULL>"),
get_unit()));
derived= get_unit();
derived_type= ((derived_type & (derived ? DTYPE_MASK : DTYPE_VIEW)) |
DTYPE_TABLE | DTYPE_MATERIALIZE);
set_check_materialized();