diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-03-28 17:06:27 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-03-28 17:31:57 +0200 |
commit | b1818dccf772e0fd495502c6dfc1600853e007d0 (patch) | |
tree | d9c441c38681d634d50cf36021a3bf439b2e44ca /sql/opt_subselect.cc | |
parent | c34602995894c9a04f4312484cfe6e45c43426e6 (diff) | |
parent | aafb9d44d65e42df72af28c940e5b23b4bc3bd43 (diff) | |
download | mariadb-git-b1818dccf772e0fd495502c6dfc1600853e007d0.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r-- | sql/opt_subselect.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index eff28d0c27d..a723980ad50 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -848,8 +848,10 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs) Make sure that create_tmp_table will not fail due to too long keys. See MDEV-7122. This check is performed inside create_tmp_table also and we must do it so that we know the table has keys created. + Make sure that the length of the key for the temp_table is atleast + greater than 0. */ - if (total_key_length > tmp_table_max_key_length() || + if (!total_key_length || total_key_length > tmp_table_max_key_length() || elements > tmp_table_max_key_parts()) DBUG_RETURN(FALSE); @@ -979,6 +981,10 @@ bool check_for_outer_joins(List<TABLE_LIST> *join_list) void find_and_block_conversion_to_sj(Item *to_find, List_iterator_fast<Item_in_subselect> &li) { + if (to_find->type() == Item::FUNC_ITEM && + ((Item_func*)to_find)->functype() == Item_func::IN_OPTIMIZER_FUNC) + to_find= ((Item_in_optimizer*)to_find)->get_wrapped_in_subselect_item(); + if (to_find->type() != Item::SUBSELECT_ITEM || ((Item_subselect *) to_find)->substype() != Item_subselect::IN_SUBS) return; |