@brief Perform "Hint Resolution" for Optimizer Hints (see opt_hints.h for definition). @detail Hints use "Explain select numbering", so this must be called after the call to LEX::fix_first_select_number(). On the other hand, this must be called before the first attempt to check any hint. */
| 1811 | any hint. |
| 1812 | */ |
| 1813 | void LEX::resolve_optimizer_hints() |
| 1814 | { |
| 1815 | if (selects_for_hint_resolution.is_empty()) |
| 1816 | return; |
| 1817 | |
| 1818 | Query_arena *arena, backup; |
| 1819 | arena= thd->activate_stmt_arena_if_needed(&backup); |
| 1820 | |
| 1821 | List_iterator<SELECT_LEX> it(selects_for_hint_resolution); |
| 1822 | SELECT_LEX *sel; |
| 1823 | while ((sel= it++)) |
| 1824 | { |
| 1825 | if (!sel->parsed_optimizer_hints) |
| 1826 | continue; |
| 1827 | Parse_context pc(thd, sel); |
| 1828 | sel->parsed_optimizer_hints->resolve(&pc); |
| 1829 | } |
| 1830 | |
| 1831 | selects_for_hint_resolution.empty(); |
| 1832 | if (arena) |
| 1833 | thd->restore_active_arena(arena, &backup); |
| 1834 | } |
| 1835 | |
| 1836 | |
| 1837 | #ifndef DBUG_OFF |
no test coverage detected