diff options
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r-- | sql/opt_subselect.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 4c7925e3e71..5137d8a0986 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -873,7 +873,8 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs) 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. */ - if (total_key_length > HA_MAX_KEY_LENGTH || elements > HA_MAX_KEY_SEG) + if (total_key_length > tmp_table_max_key_length() || + elements > tmp_table_max_key_parts()) DBUG_RETURN(FALSE); in_subs->types_allow_materialization= TRUE; |