summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-11-04 14:09:54 +0200
committerunknown <monty@narttu.mysql.fi>2003-11-04 14:09:54 +0200
commitd2293bea05b4c313ec96bdcda0fd033b60da100b (patch)
tree5f1aaae2584b2b34fffefab21f3a00c0b4d91551 /sql/sql_select.cc
parent0712ce9ec5d3b84acfcb33ebe8b653ed6e0f084c (diff)
parent7b91ab764ba69cea283432d9bd02b487cefd03c5 (diff)
downloadmariadb-git-d2293bea05b4c313ec96bdcda0fd033b60da100b.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into narttu.mysql.fi:/my/mysql-4.1 sql/sql_select.cc: Auto merged sql/unireg.cc: Auto merged
Diffstat (limited to 'sql/sql_select.cc')
-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 3decbd62a2c..091bde26b0a 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))
{