summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-11-04 13:28:36 +0200
committerunknown <bell@sanja.is.com.ua>2003-11-04 13:28:36 +0200
commit91b53294dfa28bf576d1662db9ba910a19570f0f (patch)
tree024aaa1cda06e3644d09ae5a464ff81f905468c5
parent92c280552fee94ed016a05f5012954f71cd3cd90 (diff)
downloadmariadb-git-91b53294dfa28bf576d1662db9ba910a19570f0f.tar.gz
avoid problem when all tables are const
-rw-r--r--sql/sql_select.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index bdaed894a52..8df64e2040c 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -862,7 +862,8 @@ JOIN::optimize()
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.
*/
- 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 &&
(order && simple_order || group_list && simple_group))
{