1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge branch '10.5' into 10.6

This commit is contained in:
Sergei Golubchik
2021-12-07 22:11:30 +01:00
18 changed files with 391 additions and 81 deletions

View File

@ -5754,6 +5754,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
if (!s->const_keys.is_clear_all())
{
sargable_cond= get_sargable_cond(join, s->table);
bool is_sargable_cond_of_where= sargable_cond == &join->conds;
select= make_select(s->table, found_const_table_map,
found_const_table_map,
@ -5770,6 +5771,12 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
*/
*sargable_cond= select->cond;
if (is_sargable_cond_of_where &&
join->conds && join->conds->type() == Item::COND_ITEM &&
((Item_cond*) (join->conds))->functype() ==
Item_func::COND_AND_FUNC)
join->cond_equal= &((Item_cond_and*) (join->conds))->m_cond_equal;
s->quick=select->quick;
s->needed_reg=select->needed_reg;
select->quick=0;