Commit d6b0767c authored by Igor Babaev's avatar Igor Babaev

Fixed a valgrind problem.

The function setup_tables should handle table_list elements for
semijoin materialized tables in a special way when executing
a prepared statement for the second time.
parent 3cf0d6f4
......@@ -7829,10 +7829,17 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
List_iterator_fast <TABLE_LIST> ti(select_lex->leaf_tables_exec);
select_lex->leaf_tables.empty();
while ((table_list= ti++))
{
if(table_list->jtbm_subselect)
{
table_list->jtbm_table_no= table_list->tablenr_exec;
}
else
{
table_list->table->tablenr= table_list->tablenr_exec;
table_list->table->map= table_list->map_exec;
table_list->table->pos_in_table_list= table_list;
}
select_lex->leaf_tables.push_back(table_list);
}
}
......
......@@ -826,6 +826,7 @@ inject_jtbm_conds(JOIN *join, List<TABLE_LIST> *join_list, Item **join_where)
//repeat of convert_subq_to_jtbm:
table->table= hash_sj_engine->tmp_table;
table->table->pos_in_table_list= table;
setup_table_map(table->table, table, table->jtbm_table_no);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment