1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-17781: Server crashes in next_linear_tab

For degenerate joins we may have JOIN::table_list as NULL, so instead
of using JOIN::top_join_tab_count use the function JOIN::exec_join_tab_cnt
to get the number of tables joined at the top level.
This commit is contained in:
Varun Gupta
2019-05-03 09:35:47 +05:30
parent ce195987c3
commit e292c67bb2
3 changed files with 33 additions and 1 deletions

View File

@ -8867,7 +8867,7 @@ JOIN_TAB *next_linear_tab(JOIN* join, JOIN_TAB* tab,
}
/* If no more JOIN_TAB's on the top level */
if (++tab == join->join_tab + join->top_join_tab_count + join->aggr_tables)
if (++tab >= join->join_tab + join->exec_join_tab_cnt() + join->aggr_tables)
return NULL;
if (include_bush_roots == WITHOUT_BUSH_ROOTS && tab->bush_children)