summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-02-10 00:00:07 +0300
committerunknown <evgen@moonbone.local>2007-02-10 00:00:07 +0300
commit308da65162429ae0d505a3e04736e57acfea11de (patch)
tree3d0a09437fbcbef918d34a77d0ba717620153d27 /sql/sql_lex.cc
parent762aa1c0bd6cb246eee418926985c4ac3187e2d1 (diff)
downloadmariadb-git-308da65162429ae0d505a3e04736e57acfea11de.tar.gz
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.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index a362e6c7fd2..ce76c35b33c 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1751,7 +1751,6 @@ bool st_lex::can_be_merged()
}
return (selects_allow_merge &&
- select_lex.order_list.elements == 0 &&
select_lex.group_list.elements == 0 &&
select_lex.having == 0 &&
select_lex.with_sum_func == 0 &&