Commit baeeb9ba authored by Sergei Petrunia's avatar Sergei Petrunia

Select Handlers: Initialize JOIN::fields when running with pushed select

Failure to do this causes crashes if query output is piped to an output
that requires a [pseudo] temporary table.
parent 71e8183e
...@@ -1594,6 +1594,9 @@ int JOIN::optimize() ...@@ -1594,6 +1594,9 @@ int JOIN::optimize()
join_optimization_state init_state= optimization_state; join_optimization_state init_state= optimization_state;
if (select_lex->pushdown_select) if (select_lex->pushdown_select)
{ {
// Do same as JOIN::optimize_inner does:
fields= &select_lex->item_list;
if (!(select_options & SELECT_DESCRIBE)) if (!(select_options & SELECT_DESCRIBE))
{ {
/* Prepare to execute the query pushed into a foreign engine */ /* Prepare to execute the query pushed into a foreign engine */
......
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