diff options
author | Georgi Kodinov <joro@sun.com> | 2009-10-07 18:03:42 +0300 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-10-07 18:03:42 +0300 |
commit | 1a48dd4e2bf0c6353bbf76b1f9b768620e0aa090 (patch) | |
tree | e8b98d4a75e63235bc86e6683cdea26c65b05c21 /sql/sql_base.cc | |
parent | 9226c847f5ac5424b50da07623e6e75a60725bc0 (diff) | |
download | mariadb-git-1a48dd4e2bf0c6353bbf76b1f9b768620e0aa090.tar.gz |
Bug #43029: FORCE INDEX FOR ORDER BY is ignored when join
buffering is used
FORCE INDEX FOR ORDER BY now prevents the optimizer from
using join buffering. As a result the optimizer can use
indexed access on the first table and doesn't need to
sort the complete resultset at the end of the statement.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d1e96fcdbb3..e706bd04ea6 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2305,7 +2305,8 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in) table->tablenr=thd->current_tablenr++; table->used_fields=0; table->const_table=0; - table->null_row= table->maybe_null= table->force_index= 0; + table->null_row= table->maybe_null= 0; + table->force_index= table->force_index_order= table->force_index_group= 0; table->status=STATUS_NO_RECORD; DBUG_RETURN(FALSE); } @@ -2963,7 +2964,8 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, table->tablenr=thd->current_tablenr++; table->used_fields=0; table->const_table=0; - table->null_row= table->maybe_null= table->force_index= 0; + table->null_row= table->maybe_null= 0; + table->force_index= table->force_index_order= table->force_index_group= 0; table->status=STATUS_NO_RECORD; table->insert_values= 0; table->fulltext_searched= 0; |