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

Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

This commit is contained in:
Alexander Barkov
2017-05-05 16:12:54 +04:00
398 changed files with 15220 additions and 4380 deletions

View File

@ -302,7 +302,8 @@ int select_union_recursive::send_data(List<Item> &values)
{
int rc= select_unit::send_data(values);
if (write_err != HA_ERR_FOUND_DUPP_KEY)
if (write_err != HA_ERR_FOUND_DUPP_KEY &&
write_err != HA_ERR_FOUND_DUPP_UNIQUE)
{
int err;
if ((err= incr_table->file->ha_write_tmp_row(table->record[0])))
@ -1205,7 +1206,8 @@ bool st_select_lex_unit::exec()
if (executed && !uncacheable && !describe)
DBUG_RETURN(FALSE);
executed= 1;
if (!(uncacheable & ~UNCACHEABLE_EXPLAIN) && item)
if (!(uncacheable & ~UNCACHEABLE_EXPLAIN) && item &&
!item->with_recursive_reference)
item->make_const();
saved_error= optimize();
@ -1537,9 +1539,15 @@ bool st_select_lex_unit::exec_recursive()
!is_unrestricted);
if (!with_element->rec_result->first_rec_table_to_update)
with_element->rec_result->first_rec_table_to_update= rec_table;
if (with_element->level == 1)
if (with_element->level == 1 && rec_table->reginfo.join_tab)
rec_table->reginfo.join_tab->preread_init_done= true;
}
for (Item_subselect *sq= with_element->sq_with_rec_ref.first;
sq;
sq= sq->next_with_rec_ref)
{
sq->engine->force_reexecution();
}
thd->lex->current_select= lex_select_save;
err: