mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MWL#17: Table elimination
Fixes after post-review fixes: - Don't search for tables in JOIN_TAB array. it's not initialized yet. use select_lex->leaf_tables instead.
This commit is contained in:
parent
b3f18c8866
commit
536754c8c6
1 changed files with 4 additions and 8 deletions
|
@ -676,16 +676,12 @@ Outer_join_dep *get_outer_join_dep(Table_elimination *te,
|
|||
if (!(table_dep= te->table_deps[idx]))
|
||||
{
|
||||
TABLE *table= NULL;
|
||||
/*
|
||||
Locate and create the table. The search isnt very efficient but
|
||||
typically we won't get here as we process the ON expression first
|
||||
and that will create the Table_dep
|
||||
*/
|
||||
for (uint i= 0; i < te->join->tables; i++)
|
||||
for (TABLE_LIST *tlist= te->join->select_lex->leaf_tables; tlist;
|
||||
tlist=tlist->next_leaf)
|
||||
{
|
||||
if (te->join->join_tab[i].table->tablenr == (uint)idx)
|
||||
if (tlist->table->tablenr == (uint)idx)
|
||||
{
|
||||
table= te->join->join_tab[i].table;
|
||||
table=tlist->table;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue