mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31073 Server crash, assertion `table != 0 && view->field_translation != 0' failure with ROWNUM and view
Now the same rule applied to vews and derived tables. So we should allow merge of views (and derived) in queries with rownum, because it do not change results, only makes query plans better.
This commit is contained in:
@@ -28739,7 +28739,7 @@ void st_select_lex::print_item_list(THD *thd, String *str,
|
||||
outer_select() can not be used here because it is for name resolution
|
||||
and will return NULL at any end of name resolution chain (view/derived)
|
||||
*/
|
||||
bool top_level= (get_master() == &thd->lex->unit);
|
||||
bool top_level= is_query_topmost(thd);
|
||||
List_iterator_fast<Item> it(item_list);
|
||||
Item *item;
|
||||
while ((item= it++))
|
||||
@@ -28846,7 +28846,7 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
|
||||
return;
|
||||
}
|
||||
|
||||
bool top_level= (get_master() == &thd->lex->unit);
|
||||
bool top_level= is_query_topmost(thd);
|
||||
enum explainable_cmd_type sel_type= SELECT_CMD;
|
||||
if (top_level)
|
||||
sel_type= get_explainable_cmd_type(thd);
|
||||
|
Reference in New Issue
Block a user