MCPcopy Create free account
hub / github.com/MariaDB/server / resolve_optimizer_hints

Method resolve_optimizer_hints

sql/opt_hints.cc:1813–1834  ·  view source on GitHub ↗

@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. */

Source from the content-addressed store, hash-verified

1811 any hint.
1812*/
1813void 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

Callers 8

mysqld_show_createFunction · 0.80
sql_parse.ccFile · 0.80
execute_sqlcom_selectFunction · 0.80
prepareMethod · 0.80
mysql_test_selectFunction · 0.80
mysql_create_viewFunction · 0.80
mysql_make_viewFunction · 0.80

Calls 5

restore_active_arenaMethod · 0.80
is_emptyMethod · 0.45
resolveMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected