summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorevgen@moonbone.local <>2008-03-28 14:31:52 +0300
committerevgen@moonbone.local <>2008-03-28 14:31:52 +0300
commit0bce8e6f9b5522bb67f7a63513db842d7cd09d8a (patch)
tree4b7e91d38fed2b7d68d6dc8135ad21790e4909ec /sql/item_subselect.cc
parentfb931bad54e03fb1894b2eb3abda7fec9568b6c4 (diff)
parent21c6145a6e70c06b36f55929223dc84edab952bf (diff)
downloadmariadb-git-0bce8e6f9b5522bb67f7a63513db842d7cd09d8a.tar.gz
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-bugteam
into moonbone.local:/work/27219-5.0-opt-mysql
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index a03a7d739b2..401751660fd 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1442,6 +1442,19 @@ Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func)
DBUG_ENTER("Item_in_subselect::select_in_like_transformer");
+ {
+ /*
+ IN/SOME/ALL/ANY subqueries aren't support LIMIT clause. Without it
+ ORDER BY clause becomes meaningless thus we drop it here.
+ */
+ SELECT_LEX *sl= current->master_unit()->first_select();
+ for (; sl; sl= sl->next_select())
+ {
+ if (sl->join)
+ sl->join->order= 0;
+ }
+ }
+
if (changed)
{
DBUG_RETURN(RES_OK);
@@ -1476,6 +1489,7 @@ Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func)
transformed= 1;
arena= thd->activate_stmt_arena_if_needed(&backup);
+
/*
Both transformers call fix_fields() only for Items created inside them,
and all that items do not make permanent changes in current item arena