coding style fix : Index_hint
This commit is contained in:
parent
5b0f4a172b
commit
54c9742922
@ -1770,7 +1770,7 @@ TABLE_LIST *st_select_lex_node::add_table_to_list (THD *thd, Table_ident *table,
|
|||||||
LEX_STRING *alias,
|
LEX_STRING *alias,
|
||||||
ulong table_join_options,
|
ulong table_join_options,
|
||||||
thr_lock_type flags,
|
thr_lock_type flags,
|
||||||
List<index_hint> *hints,
|
List<Index_hint> *hints,
|
||||||
LEX_STRING *option)
|
LEX_STRING *option)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@ -2723,7 +2723,7 @@ void st_select_lex::set_index_hint_type(enum index_hint_type type,
|
|||||||
|
|
||||||
void st_select_lex::alloc_index_hints (THD *thd)
|
void st_select_lex::alloc_index_hints (THD *thd)
|
||||||
{
|
{
|
||||||
index_hints= new (thd->mem_root) List<index_hint>();
|
index_hints= new (thd->mem_root) List<Index_hint>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2744,7 +2744,7 @@ void st_select_lex::alloc_index_hints (THD *thd)
|
|||||||
bool st_select_lex::add_index_hint (THD *thd, char *str, uint length)
|
bool st_select_lex::add_index_hint (THD *thd, char *str, uint length)
|
||||||
{
|
{
|
||||||
return index_hints->push_front (new (thd->mem_root)
|
return index_hints->push_front (new (thd->mem_root)
|
||||||
index_hint(current_index_hint_type,
|
Index_hint(current_index_hint_type,
|
||||||
current_index_hint_clause,
|
current_index_hint_clause,
|
||||||
str, length));
|
str, length));
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ typedef uchar index_clause_map;
|
|||||||
INDEX_HINT_MASK_ORDER)
|
INDEX_HINT_MASK_ORDER)
|
||||||
|
|
||||||
/* Single element of an USE/FORCE/IGNORE INDEX list specified as a SQL hint */
|
/* Single element of an USE/FORCE/IGNORE INDEX list specified as a SQL hint */
|
||||||
class index_hint : public Sql_alloc
|
class Index_hint : public Sql_alloc
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* The type of the hint : USE/FORCE/IGNORE */
|
/* The type of the hint : USE/FORCE/IGNORE */
|
||||||
@ -249,7 +249,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
LEX_STRING key_name;
|
LEX_STRING key_name;
|
||||||
|
|
||||||
index_hint (enum index_hint_type type_arg, index_clause_map clause_arg,
|
Index_hint (enum index_hint_type type_arg, index_clause_map clause_arg,
|
||||||
char *str, uint length) :
|
char *str, uint length) :
|
||||||
type(type_arg), clause(clause_arg)
|
type(type_arg), clause(clause_arg)
|
||||||
{
|
{
|
||||||
@ -441,7 +441,7 @@ public:
|
|||||||
LEX_STRING *alias,
|
LEX_STRING *alias,
|
||||||
ulong table_options,
|
ulong table_options,
|
||||||
thr_lock_type flags= TL_UNLOCK,
|
thr_lock_type flags= TL_UNLOCK,
|
||||||
List<index_hint> *hints= 0,
|
List<Index_hint> *hints= 0,
|
||||||
LEX_STRING *option= 0);
|
LEX_STRING *option= 0);
|
||||||
virtual void set_lock_for_tables(thr_lock_type lock_type) {}
|
virtual void set_lock_for_tables(thr_lock_type lock_type) {}
|
||||||
|
|
||||||
@ -719,7 +719,7 @@ public:
|
|||||||
LEX_STRING *alias,
|
LEX_STRING *alias,
|
||||||
ulong table_options,
|
ulong table_options,
|
||||||
thr_lock_type flags= TL_UNLOCK,
|
thr_lock_type flags= TL_UNLOCK,
|
||||||
List<index_hint> *hints= 0,
|
List<Index_hint> *hints= 0,
|
||||||
LEX_STRING *option= 0);
|
LEX_STRING *option= 0);
|
||||||
TABLE_LIST* get_table_list();
|
TABLE_LIST* get_table_list();
|
||||||
bool init_nested_join(THD *thd);
|
bool init_nested_join(THD *thd);
|
||||||
@ -779,9 +779,9 @@ public:
|
|||||||
/* make a list to hold index hints */
|
/* make a list to hold index hints */
|
||||||
void alloc_index_hints (THD *thd);
|
void alloc_index_hints (THD *thd);
|
||||||
/* read and clear the index hints */
|
/* read and clear the index hints */
|
||||||
List<index_hint>* pop_index_hints(void)
|
List<Index_hint>* pop_index_hints(void)
|
||||||
{
|
{
|
||||||
List<index_hint> *hints= index_hints;
|
List<Index_hint> *hints= index_hints;
|
||||||
index_hints= NULL;
|
index_hints= NULL;
|
||||||
return hints;
|
return hints;
|
||||||
}
|
}
|
||||||
@ -793,7 +793,7 @@ private:
|
|||||||
enum index_hint_type current_index_hint_type;
|
enum index_hint_type current_index_hint_type;
|
||||||
index_clause_map current_index_hint_clause;
|
index_clause_map current_index_hint_clause;
|
||||||
/* a list of USE/FORCE/IGNORE INDEX */
|
/* a list of USE/FORCE/IGNORE INDEX */
|
||||||
List<index_hint> *index_hints;
|
List<Index_hint> *index_hints;
|
||||||
};
|
};
|
||||||
typedef class st_select_lex SELECT_LEX;
|
typedef class st_select_lex SELECT_LEX;
|
||||||
|
|
||||||
|
@ -5636,7 +5636,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
|
|||||||
LEX_STRING *alias,
|
LEX_STRING *alias,
|
||||||
ulong table_options,
|
ulong table_options,
|
||||||
thr_lock_type lock_type,
|
thr_lock_type lock_type,
|
||||||
List<index_hint> *index_hints_arg,
|
List<Index_hint> *index_hints_arg,
|
||||||
LEX_STRING *option)
|
LEX_STRING *option)
|
||||||
{
|
{
|
||||||
register TABLE_LIST *ptr;
|
register TABLE_LIST *ptr;
|
||||||
|
@ -4642,11 +4642,11 @@ bool TABLE_LIST::process_index_hints(TABLE *table)
|
|||||||
key_map index_join[INDEX_HINT_FORCE + 1];
|
key_map index_join[INDEX_HINT_FORCE + 1];
|
||||||
key_map index_order[INDEX_HINT_FORCE + 1];
|
key_map index_order[INDEX_HINT_FORCE + 1];
|
||||||
key_map index_group[INDEX_HINT_FORCE + 1];
|
key_map index_group[INDEX_HINT_FORCE + 1];
|
||||||
index_hint *hint;
|
Index_hint *hint;
|
||||||
int type;
|
int type;
|
||||||
bool have_empty_use_join= FALSE, have_empty_use_order= FALSE,
|
bool have_empty_use_join= FALSE, have_empty_use_order= FALSE,
|
||||||
have_empty_use_group= FALSE;
|
have_empty_use_group= FALSE;
|
||||||
List_iterator <index_hint> iter(*index_hints);
|
List_iterator <Index_hint> iter(*index_hints);
|
||||||
|
|
||||||
/* initialize temporary variables used to collect hints of each kind */
|
/* initialize temporary variables used to collect hints of each kind */
|
||||||
for (type= INDEX_HINT_IGNORE; type <= INDEX_HINT_FORCE; type++)
|
for (type= INDEX_HINT_IGNORE; type <= INDEX_HINT_FORCE; type++)
|
||||||
|
@ -754,7 +754,7 @@ public:
|
|||||||
(TABLE_LIST::join_using_fields != NULL)
|
(TABLE_LIST::join_using_fields != NULL)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class index_hint;
|
class Index_hint;
|
||||||
struct TABLE_LIST
|
struct TABLE_LIST
|
||||||
{
|
{
|
||||||
TABLE_LIST() {} /* Remove gcc warning */
|
TABLE_LIST() {} /* Remove gcc warning */
|
||||||
@ -826,7 +826,7 @@ struct TABLE_LIST
|
|||||||
*/
|
*/
|
||||||
TABLE_LIST *next_name_resolution_table;
|
TABLE_LIST *next_name_resolution_table;
|
||||||
/* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
|
/* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
|
||||||
List<index_hint> *index_hints;
|
List<Index_hint> *index_hints;
|
||||||
TABLE *table; /* opened table */
|
TABLE *table; /* opened table */
|
||||||
uint table_id; /* table id (from binlog) for opened table */
|
uint table_id; /* table id (from binlog) for opened table */
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user