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
...@@ -7830,9 +7830,16 @@ bool setup_tables(THD *thd, Name_resolution_context *context, ...@@ -7830,9 +7830,16 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
select_lex->leaf_tables.empty(); select_lex->leaf_tables.empty();
while ((table_list= ti++)) while ((table_list= ti++))
{ {
table_list->table->tablenr= table_list->tablenr_exec; if(table_list->jtbm_subselect)
table_list->table->map= table_list->map_exec; {
table_list->table->pos_in_table_list= table_list; 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); 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) ...@@ -826,6 +826,7 @@ inject_jtbm_conds(JOIN *join, List<TABLE_LIST> *join_list, Item **join_where)
//repeat of convert_subq_to_jtbm: //repeat of convert_subq_to_jtbm:
table->table= hash_sj_engine->tmp_table; table->table= hash_sj_engine->tmp_table;
table->table->pos_in_table_list= table;
setup_table_map(table->table, table, table->jtbm_table_no); 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