MDEV-15556 MariaDB crash with big_tables=1 and CTE

This bug manifested itself when the optimizer chose an execution plan with
an access of the recursive CTE in a recursive query by key and ARIA/MYISAM
temporary tables were used to store recursive tables.
The problem appeared due to passing an incorrect parameter to the call of
instantiate_tmp_table() in the function With_element::instantiate_tmp_tables().
This commit is contained in:
Igor Babaev 2018-04-16 10:31:30 -07:00
commit e34d3184fd
3 changed files with 153 additions and 3 deletions

View file

@ -1401,7 +1401,7 @@ bool With_element::instantiate_tmp_tables()
{
if (!rec_table->is_created() &&
instantiate_tmp_table(rec_table,
rec_result->tmp_table_param.keyinfo,
rec_table->s->key_info,
rec_result->tmp_table_param.start_recinfo,
&rec_result->tmp_table_param.recinfo,
0))