summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 9bc4dfc74e7..329ea6eb281 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1302,11 +1302,13 @@ bool st_select_lex_unit::create_total_list_n_last_return(THD *thd, st_lex *lex,
return 1;
}
*new_table_list= cursor;
+ cursor->table_list= aux; //to be able mark this table as shared
new_table_list= &cursor->next;
*new_table_list= 0; // end result list
}
else
- aux->shared= 1; // Mark that it's used twice
+ // Mark that it's used twice
+ cursor->table_list->shared= aux->shared= 1;
aux->table_list= cursor;
}
}
@@ -1403,6 +1405,7 @@ ulong st_select_lex::get_table_join_options()
}
st_select_lex::st_select_lex(struct st_lex *lex)
+ :fake_select(0)
{
select_number= ++lex->thd->select_number;
init_query();