diff options
author | unknown <sanja@askmonty.org> | 2011-11-13 12:02:13 +0200 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2011-11-13 12:02:13 +0200 |
commit | f76bfc40ea697473e7f1bea211a68a22210e7b53 (patch) | |
tree | a2bd573afac2d9f2c60ed30a3ea03929eb81f296 /sql/item_cmpfunc.cc | |
parent | 3fb60b1df089b5c4df27b6039d1013039bde84e5 (diff) | |
download | mariadb-git-f76bfc40ea697473e7f1bea211a68a22210e7b53.tar.gz |
Fix for LP BUG#824425: Prohibiting subqueries in rows for left part of IN/ALL/ANY
Fix for walk() method of subqueries: always call the method on the subquery.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index a33dd090f14..5b2c862e9eb 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1436,6 +1436,7 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref) cache->setup(args[0]); if (cache->cols() == 1) { + DBUG_ASSERT(args[0]->type() != ROW_ITEM); if ((used_tables_cache= args[0]->used_tables())) cache->set_used_tables(OUTER_REF_TABLE_BIT); else @@ -1446,6 +1447,14 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref) uint n= cache->cols(); for (uint i= 0; i < n; i++) { + /* Check that the expression (part of row) do not contain a subquery */ + if (args[0]->element_index(i)->walk(&Item::is_subquery_processor, + FALSE, NULL)) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), + "SUBQUERY in ROW in left expression of IN/ALL/ANY"); + return 1; + } if (args[0]->element_index(i)->used_tables()) ((Item_cache *)cache->element_index(i))->set_used_tables(OUTER_REF_TABLE_BIT); else |