1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge 10.2 to 10.3

Temporarily disable main.cte_recursive due to hang in
an added test related to MDEV-15575.
This commit is contained in:
Marko Mäkelä
2018-04-19 15:23:21 +03:00
18 changed files with 634 additions and 187 deletions

View File

@ -413,19 +413,13 @@ select_union_recursive::create_result_table(THD *thd_arg,
if (! (incr_table= create_tmp_table(thd_arg, &tmp_table_param, *column_types,
(ORDER*) 0, false, 1,
options, HA_POS_ERROR, &empty_clex_str,
!create_table, keep_row_order)))
true, keep_row_order)))
return true;
incr_table->keys_in_use_for_query.clear_all();
for (uint i=0; i < table->s->fields; i++)
incr_table->field[i]->flags &= ~PART_KEY_FLAG;
if (create_table)
{
incr_table->file->extra(HA_EXTRA_WRITE_CACHE);
incr_table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
}
TABLE *rec_table= 0;
if (! (rec_table= create_tmp_table(thd_arg, &tmp_table_param, *column_types,
(ORDER*) 0, false, 1,
@ -469,8 +463,11 @@ void select_union_recursive::cleanup()
if (incr_table)
{
incr_table->file->extra(HA_EXTRA_RESET_STATE);
incr_table->file->ha_delete_all_rows();
if (incr_table->is_created())
{
incr_table->file->extra(HA_EXTRA_RESET_STATE);
incr_table->file->ha_delete_all_rows();
}
free_tmp_table(thd, incr_table);
}
@ -1659,16 +1656,24 @@ bool st_select_lex_unit::exec_recursive()
if (!was_executed)
save_union_explain(thd->lex->explain);
if ((saved_error= incr_table->file->ha_delete_all_rows()))
goto err;
if (with_element->level == 0)
{
if (!incr_table->is_created() &&
instantiate_tmp_table(incr_table,
tmp_table_param->keyinfo,
tmp_table_param->start_recinfo,
&tmp_table_param->recinfo,
0))
DBUG_RETURN(1);
incr_table->file->extra(HA_EXTRA_WRITE_CACHE);
incr_table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
start= first_select();
if (with_element->with_anchor)
end= with_element->first_recursive;
}
else if ((saved_error= incr_table->file->ha_delete_all_rows()))
goto err;
for (st_select_lex *sl= start ; sl != end; sl= sl->next_select())
{
if (with_element->level)