1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge branch bb-10.4-release into bb-10.5-release

This commit is contained in:
Nikita Malyavin
2021-05-05 23:17:20 +03:00
109 changed files with 1802 additions and 534 deletions

View File

@ -859,7 +859,8 @@ Item* period_get_condition(THD *thd, TABLE_LIST *table, SELECT_LEX *select,
cond3= newx Item_func_le(thd, conds->start.item, conds->end.item);
break;
case SYSTEM_TIME_BEFORE:
cond1= newx Item_func_lt(thd, conds->field_end, conds->start.item);
cond1= newx Item_func_history(thd, conds->field_end);
cond2= newx Item_func_lt(thd, conds->field_end, conds->start.item);
break;
default:
DBUG_ASSERT(0);
@ -912,7 +913,8 @@ Item* period_get_condition(THD *thd, TABLE_LIST *table, SELECT_LEX *select,
cond3= newx Item_func_le(thd, conds->start.item, conds->end.item);
break;
case SYSTEM_TIME_BEFORE:
cond1= newx Item_func_trt_trx_sees(thd, trx_id0, conds->field_end);
cond1= newx Item_func_history(thd, conds->field_end);
cond2= newx Item_func_trt_trx_sees(thd, trx_id0, conds->field_end);
break;
default:
DBUG_ASSERT(0);
@ -10841,6 +10843,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j,
j->ref.disable_cache= FALSE;
j->ref.null_ref_part= NO_REF_PART;
j->ref.const_ref_part_map= 0;
j->ref.uses_splitting= FALSE;
keyuse=org_keyuse;
store_key **ref_key= j->ref.key_copy;
@ -10889,6 +10892,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j,
j->ref.null_rejecting|= (key_part_map)1 << i;
keyuse_uses_no_tables= keyuse_uses_no_tables && !keyuse->used_tables;
j->ref.uses_splitting |= (keyuse->validity_ref != NULL);
/*
We don't want to compute heavy expressions in EXPLAIN, an example would
select * from t1 where t1.key=(select thats very heavy);
@ -23557,7 +23561,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
todo: why does JT_REF_OR_NULL mean filesort? We could find another index
that satisfies the ordering. I would just set ref_key=MAX_KEY here...
*/
if (tab->type == JT_REF_OR_NULL || tab->type == JT_FT)
if (tab->type == JT_REF_OR_NULL || tab->type == JT_FT ||
tab->ref.uses_splitting)
goto use_filesort;
}
else if (select && select->quick) // Range found by opt_range