1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.5 into 10.6

This commit is contained in:
Marko Mäkelä
2021-02-17 19:39:05 +02:00
326 changed files with 22430 additions and 4070 deletions

View File

@@ -2075,7 +2075,7 @@ JOIN::optimize_inner()
join->optimization_state == JOIN::OPTIMIZATION_PHASE_1_DONE &&
join->with_two_phase_optimization)
continue;
/*
/*
Do not push conditions from where into materialized inner tables
of outer joins: this is not valid.
*/
@@ -2277,7 +2277,7 @@ setup_subq_exit:
if (with_two_phase_optimization)
optimization_state= JOIN::OPTIMIZATION_PHASE_1_DONE;
else
{
{
if (optimize_stage2())
DBUG_RETURN(1);
}
@@ -2297,7 +2297,7 @@ int JOIN::optimize_stage2()
if (unlikely(thd->check_killed()))
DBUG_RETURN(1);
/* Generate an execution plan from the found optimal join order. */
if (get_best_combination())
DBUG_RETURN(1);
@@ -3957,7 +3957,7 @@ bool JOIN::setup_subquery_caches()
if (tmp_having)
{
DBUG_ASSERT(having == NULL);
if (!(tmp_having=
if (!(tmp_having=
tmp_having->transform(thd,
&Item::expr_cache_insert_transformer,
NULL)))
@@ -6929,7 +6929,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
Special treatment for ft-keys.
*/
bool sort_and_filter_keyuse(THD *thd, DYNAMIC_ARRAY *keyuse,
bool sort_and_filter_keyuse(THD *thd, DYNAMIC_ARRAY *keyuse,
bool skip_unprefixed_keyparts)
{
KEYUSE key_end, *prev, *save_pos, *use;
@@ -8167,7 +8167,7 @@ best_access_path(JOIN *join,
pos->use_join_buffer= best_uses_jbuf;
pos->spl_plan= spl_plan;
pos->range_rowid_filter_info= best_filter;
loose_scan_opt.save_to_position(s, loose_scan_pos);
if (!best_key &&
@@ -10312,7 +10312,7 @@ bool JOIN::check_two_phase_optimization(THD *thd)
return true;
return false;
}
bool JOIN::inject_cond_into_where(Item *injected_cond)
{
@@ -10343,7 +10343,7 @@ bool JOIN::inject_cond_into_where(Item *injected_cond)
and_args->push_back(elem, thd->mem_root);
}
}
return false;
}
@@ -18488,9 +18488,9 @@ bool Create_tmp_table::add_fields(THD *thd,
distinct_record_structure= true;
}
li.rewind();
uint uneven_delta= 0;
while ((item=li++))
{
uint uneven_delta;
current_counter= (((param->hidden_field_count < (fieldnr + 1)) &&
distinct_record_structure &&
(!m_with_cycle ||
@@ -18553,8 +18553,8 @@ bool Create_tmp_table::add_fields(THD *thd,
uneven_delta= m_uneven_bit_length;
add_field(table, new_field, fieldnr++, param->force_not_null_cols);
uneven_delta= m_uneven_bit_length - uneven_delta;
m_field_count[current_counter]++;
m_uneven_bit[current_counter]+= (m_uneven_bit_length - uneven_delta);
if (!(new_field->flags & NOT_NULL_FLAG))
{
@@ -18635,8 +18635,8 @@ bool Create_tmp_table::add_fields(THD *thd,
uneven_delta= m_uneven_bit_length;
add_field(table, new_field, fieldnr++, param->force_not_null_cols);
uneven_delta= m_uneven_bit_length - uneven_delta;
m_field_count[current_counter]++;
m_uneven_bit[current_counter]+= (m_uneven_bit_length - uneven_delta);
if (item->marker == 4 && item->maybe_null)
{
@@ -18646,7 +18646,6 @@ bool Create_tmp_table::add_fields(THD *thd,
if (current_counter == distinct)
new_field->flags|= FIELD_PART_OF_TMP_UNIQUE;
}
m_uneven_bit[current_counter]+= uneven_delta;
}
DBUG_ASSERT(fieldnr == m_field_count[other] + m_field_count[distinct]);
DBUG_ASSERT(m_blob_count == m_blobs_count[other] + m_blobs_count[distinct]);
@@ -18805,7 +18804,6 @@ bool Create_tmp_table::finalize(THD *thd,
if (!(field->flags & NOT_NULL_FLAG))
{
recinfo->null_bit= (uint8)1 << (null_counter[current_counter] & 7);
recinfo->null_pos= (null_pack_base[current_counter] +
null_counter[current_counter]/8);
@@ -24297,7 +24295,7 @@ bool
cp_buffer_from_ref(THD *thd, TABLE *table, TABLE_REF *ref)
{
Check_level_instant_set check_level_save(thd, CHECK_FIELD_IGNORE);
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
bool result= 0;
for (store_key **copy=ref->key_copy ; *copy ; copy++)
@@ -24308,7 +24306,7 @@ cp_buffer_from_ref(THD *thd, TABLE *table, TABLE_REF *ref)
break;
}
}
dbug_tmp_restore_column_map(table->write_set, old_map);
dbug_tmp_restore_column_map(&table->write_set, old_map);
return result;
}
@@ -25980,7 +25978,7 @@ bool JOIN::rollup_init()
{
if (!(rollup.null_items[i]= new (thd->mem_root) Item_null_result(thd)))
return true;
List<Item> *rollup_fields= &rollup.fields[i];
rollup_fields->empty();
rollup.ref_pointer_arrays[i]= Ref_ptr_array(ref_array, all_fields.elements);
@@ -26493,7 +26491,7 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta,
{
JOIN_TAB *ctab= bush_children->start;
/* table */
size_t len= my_snprintf(table_name_buffer,
size_t len= my_snprintf(table_name_buffer,
sizeof(table_name_buffer)-1,
"<subquery%d>",
ctab->emb_sj_nest->sj_subq_pred->get_identifier());
@@ -27636,7 +27634,7 @@ void TABLE_LIST::print(THD *thd, table_map eliminated_tables, String *str,
void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
{
DBUG_ASSERT(thd);
if (tvc)
{
tvc->print(thd, str, query_type);