Bug#12122: The MERGE algorithm isn't applicable if the ORDER BY clause is
present. A view created with CREATE VIEW ... ORDER BY ... cannot be resolved with the MERGE algorithm, even when no other part of the CREATE VIEW statement would require the view to be resolved using the TEMPTABLE algorithm. The check for presence of the ORDER BY clause in the underlying select is removed from the st_lex::can_be_merged() function. The ORDER BY list of the underlying select is appended to the ORDER BY list mysql-test/t/view.test: Added a test case for bug#12122: Views with ORDER BY can't be resolved using MERGE algorithm. mysql-test/r/view.result: Added a test case for bug#12122: Views with ORDER BY can't be resolved using MERGE algorithm. sql/sql_lex.cc: Bug#12122: Views with ORDER BY can't be resolved using MERGE algorithm. The st_lex::can_be_merged() function now allows views with the ORDER BY clause to be resolved using MERGE algorithm. The ORDER BY list of the view is appended to the ORDER BY list of the embedding select.
Showing
Please register or sign in to comment