Reverting r40790 and fixing the filesort properly (by adding an extra ORDER BY clause).