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

Method resolve

sql/opt_hints_parser.cc:317–445  ·  view source on GitHub ↗

Resolve a parsed table level hint, i.e. set up proper Opt_hint_* structures which will be used later during query preparation and optimization. @return false: no critical errors, warnings on duplicated hints, unresolved query block names, etc. are allowed true: critical error (like OOM), break further hints processing */

Source from the content-addressed store, hash-verified

315 true: critical error (like OOM), break further hints processing
316*/
317bool Parser::Table_level_hint::resolve(Parse_context *pc) const
318{
319 const Table_level_hint_type &table_level_hint_type= *this;
320 opt_hints_enum hint_type;
321 bool hint_state; // ON or OFF
322
323 switch (table_level_hint_type.id())
324 {
325 case TokenID::keyword_BNL:
326 hint_type= BNL_HINT_ENUM;
327 hint_state= true;
328 break;
329 case TokenID::keyword_NO_BNL:
330 hint_type= BNL_HINT_ENUM;
331 hint_state= false;
332 break;
333 case TokenID::keyword_BKA:
334 hint_type= BKA_HINT_ENUM;
335 hint_state= true;
336 break;
337 case TokenID::keyword_NO_BKA:
338 hint_type= BKA_HINT_ENUM;
339 hint_state= false;
340 break;
341 case TokenID::keyword_DERIVED_CONDITION_PUSHDOWN:
342 hint_type= DERIVED_CONDITION_PUSHDOWN_HINT_ENUM;
343 hint_state= true;
344 break;
345 case TokenID::keyword_NO_DERIVED_CONDITION_PUSHDOWN:
346 hint_type= DERIVED_CONDITION_PUSHDOWN_HINT_ENUM;
347 hint_state= false;
348 break;
349 case TokenID::keyword_MERGE:
350 hint_type= MERGE_HINT_ENUM;
351 hint_state= true;
352 break;
353 case TokenID::keyword_NO_MERGE:
354 hint_type= MERGE_HINT_ENUM;
355 hint_state= false;
356 break;
357 case TokenID::keyword_SPLIT_MATERIALIZED:
358 hint_type= SPLIT_MATERIALIZED_HINT_ENUM;
359 hint_state= true;
360 break;
361 case TokenID::keyword_NO_SPLIT_MATERIALIZED:
362 hint_type= SPLIT_MATERIALIZED_HINT_ENUM;
363 hint_state= false;
364 break;
365 default:
366 DBUG_ASSERT(0);
367 return true;
368 }
369
370 if (const At_query_block_name_opt_table_name_list &
371 at_query_block_name_opt_table_name_list= *this)
372 {
373 // this is @ query_block_name opt_table_name_list
374 const Lex_ident_sys qb_name_sys= Query_block_name::to_ident_sys(pc->thd);

Callers

nothing calls this directly

Calls 15

find_qb_hintsFunction · 0.85
print_warnFunction · 0.85
get_table_hintsFunction · 0.85
is_emptyFunction · 0.85
is_compound_hintFunction · 0.85
push_warning_safeFunction · 0.85
cmp_lex_string_limitFunction · 0.85
my_strtoll10Function · 0.85
is_descendant_of_unitFunction · 0.85
cmp_lex_stringFunction · 0.85
get_qb_hintsFunction · 0.85

Tested by

no test coverage detected