Commit 909c229c authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

avoid problem when all tables are const

parent 7c49da1e
...@@ -862,7 +862,8 @@ JOIN::optimize() ...@@ -862,7 +862,8 @@ JOIN::optimize()
We only need to do this when we have a simple_order or simple_group We only need to do this when we have a simple_order or simple_group
as in other cases the join is done before the sort. as in other cases the join is done before the sort.
*/ */
if ((order || group_list) && join_tab[const_tables].type != JT_ALL && if (const_tables != tables &&
(order || group_list) && join_tab[const_tables].type != JT_ALL &&
join_tab[const_tables].type != JT_FT && join_tab[const_tables].type != JT_FT &&
(order && simple_order || group_list && simple_group)) (order && simple_order || group_list && simple_group))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment