From: Date: July 7 2006 5:08pm Subject: bk commit into 4.1 tree (gkodinov:1.2522) BUG#17212 List-Archive: http://lists.mysql.com/commits/8916 X-Bug: 17212 Message-Id: <20060707150844.AFBC2F4550@macbook.gmz> Below is the list of changes that have just been committed into a local 4.1 repository of kgeorge. When kgeorge does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2006-07-07 18:08:33+03:00, gkodinov@stripped +1 -0 Bug #17212 results not sorted correctly by ORDER BY when using index * opt not to use join cache in favor of using index for ORDER BY. This choise must be made because join cache will effectively reverse the join order and the results will no longer be sorted by the index of the left table. sql/sql_select.cc@stripped, 2006-07-07 18:08:26+03:00, gkodinov@stripped +8 -1 Bug #17212 results not sorted correctly by ORDER BY when using index * don't use join cache when using index for sorting # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: gkodinov # Host: macbook.gmz # Root: /Users/kgeorge/mysql/4.1/B17212 --- 1.457/sql/sql_select.cc 2006-07-07 18:08:44 +03:00 +++ 1.458/sql/sql_select.cc 2006-07-07 18:08:44 +03:00 @@ -3924,10 +3924,17 @@ case JT_ALL: /* If previous table use cache + Note: if the previous table is using index for sorting + don't use cache. */ table->status=STATUS_NO_RECORD; if (i != join->const_tables && !(options & SELECT_NO_JOIN_CACHE) && - tab->use_quick != 2 && !tab->on_expr) + tab->use_quick != 2 && !tab->on_expr && + !(i == join->const_tables + 1 && + join->sort_by_table == join->join_tab[i - 1].table && + (!join->order || join->skip_sort_order || + test_if_skip_sort_order(&join->join_tab[i - 1], + join->order, join->select_limit, 1)))) { if ((options & SELECT_DESCRIBE) || !join_init_cache(join->thd,join->join_tab+join->const_tables,