| 20272 | */ |
| 20273 | |
| 20274 | static uint reset_nj_counters(JOIN *join, List<TABLE_LIST> *join_list) |
| 20275 | { |
| 20276 | List_iterator<TABLE_LIST> li(*join_list); |
| 20277 | TABLE_LIST *table; |
| 20278 | DBUG_ENTER("reset_nj_counters"); |
| 20279 | uint n=0; |
| 20280 | while ((table= li++)) |
| 20281 | { |
| 20282 | NESTED_JOIN *nested_join; |
| 20283 | bool is_eliminated_nest= FALSE; |
| 20284 | if ((nested_join= table->nested_join)) |
| 20285 | { |
| 20286 | nested_join->counter= 0; |
| 20287 | nested_join->n_tables= reset_nj_counters(join, &nested_join->join_list); |
| 20288 | if (!nested_join->n_tables) |
| 20289 | is_eliminated_nest= TRUE; |
| 20290 | } |
| 20291 | const table_map removed_tables= join->eliminated_tables | |
| 20292 | join->const_table_map; |
| 20293 | |
| 20294 | if ((table->nested_join && !is_eliminated_nest) || |
| 20295 | (!table->nested_join && (table->table->map & ~removed_tables))) |
| 20296 | n++; |
| 20297 | } |
| 20298 | DBUG_RETURN(n); |
| 20299 | } |
| 20300 | |
| 20301 | |
| 20302 | /** |
no outgoing calls
no test coverage detected