mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fixed numerous problems for mutually recursive CTE.
Actually mutually recursive CTE were not functional. Now the code for mutually recursive CTE looks like functional, but still needs re-writing. Added many new test cases for mutually recursive CTE.
This commit is contained in:
@@ -11605,7 +11605,12 @@ bool JOIN_TAB::preread_init()
|
||||
}
|
||||
|
||||
/* Materialize derived table/view. */
|
||||
if ((!derived->get_unit()->executed || derived->is_recursive_with_table()) &&
|
||||
if ((!derived->get_unit()->executed ||
|
||||
(derived->is_recursive_with_table() &&
|
||||
(!derived->is_with_table_recursive_reference() ||
|
||||
(!derived->with->is_driving_recursive() &&
|
||||
!derived->with->is_incr_ready()) &&
|
||||
!derived->with->all_are_stabilized()))) &&
|
||||
mysql_handle_single_derived(join->thd->lex,
|
||||
derived, DT_CREATE | DT_FILL))
|
||||
return TRUE;
|
||||
@@ -18236,7 +18241,8 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
|
||||
flush_dups_table->sj_weedout_delete_rows();
|
||||
}
|
||||
|
||||
if (!join_tab->preread_init_done && join_tab->preread_init())
|
||||
if ((!join_tab->preread_init_done || join_tab->table->is_rec_table) &&
|
||||
join_tab->preread_init())
|
||||
DBUG_RETURN(NESTED_LOOP_ERROR);
|
||||
|
||||
join->return_tab= join_tab;
|
||||
@@ -19189,7 +19195,8 @@ int join_init_read_record(JOIN_TAB *tab)
|
||||
report_error(tab->table, error);
|
||||
return 1;
|
||||
}
|
||||
if (!tab->preread_init_done && tab->preread_init())
|
||||
if ((!tab->preread_init_done || tab->table->is_rec_table) &&
|
||||
tab->preread_init())
|
||||
return 1;
|
||||
if (init_read_record(&tab->read_record, tab->join->thd, tab->table,
|
||||
tab->select, tab->filesort_result, 1,1, FALSE))
|
||||
|
||||
Reference in New Issue
Block a user