mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#52711 Segfault when doing EXPLAIN SELECT with union...order by (select... where...)
backport from 5.1
This commit is contained in:
@@ -501,7 +501,7 @@ JOIN::prepare(Item ***rref_pointer_array,
|
||||
thd->lex->allow_sum_func= save_allow_sum_func;
|
||||
}
|
||||
|
||||
if (!thd->lex->view_prepare_mode)
|
||||
if (!thd->lex->view_prepare_mode && !(select_options & SELECT_DESCRIBE))
|
||||
{
|
||||
Item_subselect *subselect;
|
||||
/* Is it subselect? */
|
||||
@@ -6861,7 +6861,8 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond,
|
||||
*simple_order=0; // Must do a temp table to sort
|
||||
else if (!(order_tables & not_const_tables))
|
||||
{
|
||||
if (order->item[0]->with_subselect)
|
||||
if (order->item[0]->with_subselect &&
|
||||
!(join->select_lex->options & SELECT_DESCRIBE))
|
||||
order->item[0]->val_str(&order->item[0]->str_value);
|
||||
DBUG_PRINT("info",("removing: %s", order->item[0]->full_name()));
|
||||
continue; // skip const item
|
||||
|
||||
Reference in New Issue
Block a user