Commit 8d09a0d7 authored by Sergei Petrunia's avatar Sergei Petrunia

Make parsed output: SELECT_LEX::parsed_optimizer_hints const.

This required changing some other functions to const too.
parent c8ce9fbb
...@@ -685,7 +685,7 @@ bool Optimizer_hint_parser::Qb_name_hint::resolve(Parse_context *pc) const ...@@ -685,7 +685,7 @@ bool Optimizer_hint_parser::Qb_name_hint::resolve(Parse_context *pc) const
} }
bool Optimizer_hint_parser::Hint_list::resolve(Parse_context *pc) bool Optimizer_hint_parser::Hint_list::resolve(Parse_context *pc) const
{ {
if (pc->thd->lex->create_view) if (pc->thd->lex->create_view)
{ {
...@@ -699,20 +699,20 @@ bool Optimizer_hint_parser::Hint_list::resolve(Parse_context *pc) ...@@ -699,20 +699,20 @@ bool Optimizer_hint_parser::Hint_list::resolve(Parse_context *pc)
if (!get_qb_hints(pc)) if (!get_qb_hints(pc))
return true; return true;
List_iterator_fast<Optimizer_hint_parser::Hint> li(*this); for (Hint_list::const_iterator li= this->cbegin(); li != this->cend(); ++li)
while(Optimizer_hint_parser::Hint *hint= li++)
{ {
if (const Table_level_hint &table_hint= *hint) const Optimizer_hint_parser::Hint &hint= *li;
if (const Table_level_hint &table_hint= hint)
{ {
if (table_hint.resolve(pc)) if (table_hint.resolve(pc))
return true; return true;
} }
else if (const Index_level_hint &index_hint= *hint) else if (const Index_level_hint &index_hint= hint)
{ {
if (index_hint.resolve(pc)) if (index_hint.resolve(pc))
return true; return true;
} }
else if (const Qb_name_hint &qb_hint= *hint) else if (const Qb_name_hint &qb_hint= hint)
{ {
if (qb_hint.resolve(pc)) if (qb_hint.resolve(pc))
return true; return true;
......
...@@ -585,7 +585,7 @@ class Optimizer_hint_parser: public Optimizer_hint_tokenizer, ...@@ -585,7 +585,7 @@ class Optimizer_hint_parser: public Optimizer_hint_tokenizer,
public: public:
using LIST::LIST; using LIST::LIST;
bool resolve(Parse_context *pc); bool resolve(Parse_context *pc) const;
}; };
public: public:
......
...@@ -1264,7 +1264,7 @@ class st_select_lex: public st_select_lex_node ...@@ -1264,7 +1264,7 @@ class st_select_lex: public st_select_lex_node
/* it is for correct printing SELECT options */ /* it is for correct printing SELECT options */
thr_lock_type lock_type; thr_lock_type lock_type;
Optimizer_hint_parser_output *parsed_optimizer_hints; const Optimizer_hint_parser_output *parsed_optimizer_hints;
/** System Versioning */ /** System Versioning */
int vers_setup_conds(THD *thd, TABLE_LIST *tables); int vers_setup_conds(THD *thd, TABLE_LIST *tables);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment